move upt into lib

This commit is contained in:
2022-08-23 01:09:53 +08:00
parent 12dbe39285
commit 35223658c5
+3 -7
View File
@@ -1,8 +1,4 @@
package.path = package.path .. ';<SCRIPT_PATH>/?.lua';
local upt = require("lib.upt")
local uri = ngx.unescape_uri(ngx.var.arg_uri)
local secret = ngx.var.upt_secret
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)
local upt = string.sub(sign, 13, 13 + 7) .. etime
ngx.say(upt)
ngx.say(upt.upt(uri))