From ee2e656e5a5a4c6fe19740a7f98979aa68d5e5ba Mon Sep 17 00:00:00 2001 From: loveshell <82163261@qq.com> Date: Sun, 19 Apr 2015 12:25:06 +0800 Subject: [PATCH] fix match --- init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index cfd477e..eb44bf0 100644 --- a/init.lua +++ b/init.lua @@ -93,9 +93,11 @@ function fileExtCheck(ext) local items = Set(black_fileExt) ext=string.lower(ext) if ext then - if items[ext] then - log('POST',ngx.var.request_uri,"-","file attack with ext "..ext) + for rule in pairs(items) do + if ngx.re.match(ext,rule,"isjo") then + log('POST',ngx.var.request_uri,"-","file attack with ext "..ext) say_html() + end end end return false