File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -9,29 +9,18 @@ function _M.run(config)
9
9
if config .modules .manager .enable ~= true then
10
10
return
11
11
end
12
-
13
12
local base_uri = ' /waf'
14
- if string.find (ngx .var .uri , base_uri ) ~= 1 then
15
- return
16
- end
17
-
18
- _M .auth_check (config .modules .manager .auth )
19
-
20
- local uri = ngx .var .uri
21
13
local method = ngx .req .get_method ()
22
14
local path = string.sub ( ngx .var .uri , string.len ( base_uri ) + 1 )
23
15
for i ,item in ipairs ( _M .routes ) do
24
16
if method == item [' method' ] and path == item [' path' ] then
17
+ _M .auth_check (config .modules .manager .auth )
25
18
ngx .header .content_type = " application/json"
26
19
ngx .header .charset = " utf-8"
27
20
ngx .say (item [' handle' ](config ))
28
21
ngx .exit (ngx .HTTP_OK )
29
22
end
30
23
end
31
- ngx .status = ngx .HTTP_NOT_FOUND
32
- ngx .header .content_type = " application/json"
33
- ngx .say (' {"code": 404, "message":"Not Found"}' )
34
- ngx .exit (ngx .HTTP_OK )
35
24
end
36
25
37
26
function _M .config_get (config )
You can’t perform that action at this time.
0 commit comments