From e52e7bf297b3319bd7cfc4390a701c4f6fa1c2bf Mon Sep 17 00:00:00 2001 From: loveshell <82163261@qq.com> Date: Wed, 17 Apr 2013 01:12:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=8Bpost?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- waf.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/waf.lua b/waf.lua index c47bbef..a336230 100644 --- a/waf.lua +++ b/waf.lua @@ -12,11 +12,13 @@ else elseif ngx.var.http_user_agent and ngx.re.match(ngx.var.http_user_agent,regex.."|"..agent,"isjo") then log('USER-AGENT',ngx.unescape_uri(ngx.var.request_uri)) check() - elseif ngx.req.get_method()=='POST' and ngx.re.match(ngx.unescape_uri(ngx.req.get_body_data()),regex.."|"..post,"isjo") then + elseif ngx.req.get_body_data() and ngx.re.match(ngx.req.get_body_data(),[[Content-Disposition: form-data;(.*)filename=]],"isjo") ==nil and ngx.re.match(ngx.unescape_uri(ngx.req.get_body_data()),regex.."|"..post,"isjo") then log('POST',ngx.unescape_uri(ngx.var.request_uri),ngx.unescape_uri(ngx.req.get_body_data())) - check() - elseif string.len(filext) >0 and ngx.req.get_body_data() and ngx.re.match(ngx.req.get_body_data(),[[^(Content-Disposition: form-data;(.*)filename="(.*).("..filext..")").*$]],"isjo") then - check() + check() + elseif string.len(filext) >0 then + if ngx.req.get_body_data() and ngx.re.match(ngx.req.get_body_data(),"Content-Disposition: form-data;(.*)filename=\"(.*)."..filext.."\"","isjo") then + check() + end -- elseif ngx.req.get_headers()["Cookie"] and ngx.re.match(ngx.unescape_uri(ngx.req.get_headers()["Cookie"]),regex,"isjo")then -- log('COOKIE',ngx.unescape_uri(ngx.var.request_uri),ngx.unescape_uri(ngx.req.get_headers()["Cookie"])) -- check()