Skip to content

Commit

Permalink
修改了下post处理逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
loveshell committed Apr 16, 2013
1 parent 6d1286a commit e52e7bf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions waf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit e52e7bf

Please sign in to comment.