Remove session-cookie-hash annotation
This commit is contained in:
parent
79c52cf094
commit
d3ac73be79
18 changed files with 22 additions and 189 deletions
|
|
@ -1,8 +1,5 @@
|
|||
local string_len = string.len
|
||||
local string_sub = string.sub
|
||||
local resty_str = require("resty.string")
|
||||
local resty_sha1 = require("resty.sha1")
|
||||
local resty_md5 = require("resty.md5")
|
||||
|
||||
local _M = {}
|
||||
|
||||
|
|
@ -18,30 +15,6 @@ function _M.get_nodes(endpoints)
|
|||
return nodes
|
||||
end
|
||||
|
||||
local function hash_digest(hash_factory, message)
|
||||
local hash = hash_factory:new()
|
||||
if not hash then
|
||||
return nil, "failed to create object"
|
||||
end
|
||||
local ok = hash:update(message)
|
||||
if not ok then
|
||||
return nil, "failed to add data"
|
||||
end
|
||||
local binary_digest = hash:final()
|
||||
if binary_digest == nil then
|
||||
return nil, "failed to create digest"
|
||||
end
|
||||
return resty_str.to_hex(binary_digest), nil
|
||||
end
|
||||
|
||||
function _M.sha1_digest(message)
|
||||
return hash_digest(resty_sha1, message)
|
||||
end
|
||||
|
||||
function _M.md5_digest(message)
|
||||
return hash_digest(resty_md5, message)
|
||||
end
|
||||
|
||||
-- given an Nginx variable i.e $request_uri
|
||||
-- it returns value of ngx.var[request_uri]
|
||||
function _M.lua_ngx_var(ngx_var)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue