This commit is contained in:
2022-08-23 13:55:38 +08:00
parent adc5e0ea35
commit ab1c36abf8
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ function _M.upt(uri)
local duration = ngx.var.upt_duration
local etime = os.time() + duration
local sign = ngx.md5(secret .. '&' .. etime .. '&' .. uri)
ngx.log(ngx.ERR, 'sign...' .. sign .. ' etime..' .. etime)
ngx.log(ngx.INFO, 'sign...' .. sign .. ' etime..' .. etime)
local upt = string.sub(sign, 13, 13 + 7) .. etime
return (upt)
end
+1
View File
@@ -1,4 +1,5 @@
package.path = package.path .. ';<SCRIPT_PATH>/?.lua';
local Upt = require("lib.upt")
local uri = ngx.unescape_uri(ngx.var.arg_uri)
ngx.log(ngx.INFO, 'URI -> ' .. uri)
ngx.say(Upt.upt(uri))