move upt into lib
This commit is contained in:
+3
-7
@@ -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))
|
||||
Reference in New Issue
Block a user