Commit 6367c22d by Joneq

修改代码

parent a4bc142a
Showing with 11 additions and 6 deletions
......@@ -408,6 +408,11 @@ red:lpush('spider_ip_info_list',cjson.encode(arr))
res , err = red:expire(spider_time .. user_ip , spider_key_exit_time)
res , err = red:expire(spider_count .. user_ip , spider_key_exit_time)
local ok , err = red:close()
ngx.say(ok)
ngx.say(err)
ngx.exit(ngx.HTTP_FORBIDDEN)
......
......@@ -8,7 +8,7 @@ local _Wafcheck= {}
--------白名单ip-----------
function _Wafcheck.WhiteIp(user_ip)
is_exist ,err = red:sismember('ichunt_waf_white_ip', user_ip)
local is_exist ,err = red:sismember('ichunt_waf_white_ip', user_ip)
if is_exist == 1 then
return "exist"
end
......@@ -18,7 +18,7 @@ end
--------白名单url-----------
function _Wafcheck.WhiteUrl(url)
is_exist ,err = red:sismember('ichunt_waf_white_url', url)
local is_exist ,err = red:sismember('ichunt_waf_white_url', url)
if is_exist == 1 then
return "exist"
end
......@@ -28,7 +28,7 @@ end
--------白名单header-----------
function _Wafcheck.WhiteHeader(header)
is_exist ,err = red:sismember('ichunt_waf_white_header', header)
local is_exist ,err = red:sismember('ichunt_waf_white_header', header)
if is_exist == 1 then
return "exist"
end
......@@ -39,7 +39,7 @@ end
-------黑名单Ip
function _Wafcheck.BlackIp(user_ip)
is_exist ,err = red:sismember('ichunt_waf_black_ip', user_ip)
local is_exist ,err = red:sismember('ichunt_waf_black_ip', user_ip)
if is_exist == 1 then
return "exist"
end
......@@ -49,7 +49,7 @@ end
-------黑名单Url
function _Wafcheck.BlackUrl(url)
is_exist ,err = red:sismember('ichunt_waf_black_url', url)
local is_exist ,err = red:sismember('ichunt_waf_black_url', url)
if is_exist == 1 then
return "exist"
end
......@@ -59,7 +59,7 @@ end
-------黑名单header
function _Wafcheck.BlackHeader(header)
is_exist ,err = red:sismember('ichunt_waf_black_header', header)
local is_exist ,err = red:sismember('ichunt_waf_black_header', header)
if is_exist == 1 then
return "exist"
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment