From c69674286679973570a466e39123d3a6204f9a0e Mon Sep 17 00:00:00 2001 From: midoks Date: Sun, 5 Mar 2023 18:03:41 +0800 Subject: [PATCH] Update init.lua --- plugins/op_waf/waf/lua/init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/op_waf/waf/lua/init.lua b/plugins/op_waf/waf/lua/init.lua index 4a6792e1f..ff13b6c08 100644 --- a/plugins/op_waf/waf/lua/init.lua +++ b/plugins/op_waf/waf/lua/init.lua @@ -344,6 +344,7 @@ local function waf_cc_increase() local make_uri = "/"..make_uri_str if params['uri_request_args']['token'] then + ngx.header.content_type = "application/json" local args_token = params['uri_request_args']['token'] if args_token == make_token then ngx.shared.waf_limit:set(cache_token, 1, tonumber(config['safe_verify']['time'])) @@ -351,6 +352,14 @@ local function waf_cc_increase() ngx.say(json.encode(data)) ngx.exit(200) end + + -- C:D("debug[args]:"..tostring(params['uri_request_args']['debug'])) + -- if params['uri_request_args']['debug'] == 'ok' then + -- ngx.header.content_type = "application/json" + -- local data = get_return_state(0, "ok") + -- ngx.say(json.encode(data)) + -- ngx.exit(200) + -- end end local cc_html = ngx.re.gsub(cc_safe_js_html, "{uri}", make_uri_str)