From 41a6d8cec91b89d06f3e24aad10d8156c9f0222f Mon Sep 17 00:00:00 2001 From: ibuler Date: Sun, 19 Jun 2016 11:50:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry.lua | 4 ++-- init.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/entry.lua b/entry.lua index 333f9d9..f4aaa4b 100644 --- a/entry.lua +++ b/entry.lua @@ -12,7 +12,7 @@ ip_black_list = {} --------- Init project ---------------- require 'init' --------- Access control limit -------- -if ip_check and (whiteIP(ip_white_list) or blackIP(ip_black_list)) then -elseif cc_deny and denyCC(cc_rate, cc_deny_seconds) then +if ip_check and (whiteIP(ip_white_list, debug) or blackIP(ip_black_list, debug)) then +elseif cc_deny and denyCC(cc_rate, cc_deny_seconds, debug) then else return end diff --git a/init.lua b/init.lua index d5a400c..7853b02 100644 --- a/init.lua +++ b/init.lua @@ -187,7 +187,7 @@ end -- return false -- end -function denyCC(cc_rate, cc_deny_seconds) +function denyCC(cc_rate, cc_deny_seconds, debug) local uri = ngx.var.uri cc_count = tonumber(string.match(cc_rate, '(.*)/')) cc_seconds = tonumber(string.match(cc_rate, '/(.*)'))