road to swarm - add openssl to autoconf, fix api_uri in LUA, fix file rights
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
local M = {}
|
||||
local api_uri = ngx.var.api_uri
|
||||
local api_list = {}
|
||||
|
||||
api_list["^/reload$"] = function ()
|
||||
return os.execute("/usr/sbin/nginx -s reload") == 0
|
||||
end
|
||||
|
||||
function M.is_api_call ()
|
||||
function M.is_api_call (api_uri)
|
||||
if ngx.var.request_uri:sub(1, #api_uri) .. "/" == api_uri .. "/" then
|
||||
for uri, code in pairs(api_list) do
|
||||
if string.match(ngx.var.request_uri:sub(#api_uri + 1), uri) then
|
||||
@@ -17,7 +16,7 @@ function M.is_api_call ()
|
||||
return false
|
||||
end
|
||||
|
||||
function M.do_api_call ()
|
||||
function M.do_api_call (api_uri)
|
||||
for uri, code in pairs(api_list) do
|
||||
if string.match(ngx.var.request_uri:sub(#api_uri + 1), uri) then
|
||||
return code()
|
||||
|
||||
Reference in New Issue
Block a user