...
|
...
|
@@ -34,23 +34,3 @@ function M.get_req_param(req_param) |
|
|
end
|
|
|
|
|
|
|
|
|
function M.get_get_req_param(req_param)
|
|
|
local args , err = ngx.req.get_uri_args()
|
|
|
--- make sure this is some params
|
|
|
if not args then
|
|
|
ngx.say("failed to get args: ", err)
|
|
|
return nil
|
|
|
end
|
|
|
|
|
|
-- the value may be table, like: /test?foo=bar&bar=baz&bar=blah
|
|
|
local val=args[req_param]
|
|
|
if type(val) == "table" then
|
|
|
for k,v in pairs(val) do
|
|
|
if v then
|
|
|
return v
|
|
|
end
|
|
|
end
|
|
|
else
|
|
|
return val
|
|
|
end
|
|
|
end |
|
|
\ No newline at end of file |
...
|
...
|
|