Skip to content

Commit

Permalink
取消%号替换为空
Browse files Browse the repository at this point in the history
  • Loading branch information
loveshell committed Mar 26, 2013
1 parent 5112d10 commit a98018f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions waf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@ if ngx.re.match(ngx.var.request_uri,whitelist,"isjo") then
elseif ngx.req.get_body_data() and ngx.re.match(ngx.req.get_body_data(),[[^(?!Content-Disposition: form-data;(.*)filename="(.*).(php|jsp|phtml|asp|aspx|cgi)").*$]],"isjo") then
return
else
if ngx.re.match(string.gsub(ngx.unescape_uri(ngx.var.request_uri),"\\%",""),regex.."|"..get,"isjo") then
if ngx.re.match(ngx.unescape_uri(ngx.var.request_uri),regex.."|"..get,"isjo") then
log('GET',ngx.unescape_uri(ngx.var.request_uri))
check()
-- elseif ngx.re.match(ngx.re.gsub(ngx.var.request_uri,"\\%",""),regex.."|"..get,"isjo") then
-- log('GET',ngx.var.request_uri)
-- check()
elseif ngx.req.get_body_data() and ngx.re.match(string.gsub(ngx.unescape_uri(ngx.req.get_body_data()),"\\%",""),regex,"isjo")then
elseif ngx.req.get_body_data() and ngx.re.match(ngx.unescape_uri(ngx.req.get_body_data(),regex,"isjo")then
log('POST',ngx.unescape_uri(ngx.var.request_uri),ngx.unescape_uri(ngx.req.get_body_data()))
check()
-- elseif ngx.req.get_body_data() and ngx.re.match(string.gsub(ngx.req.get_body_data(),"\\%",""),regex,"isjo")then
-- log('POST',ngx.unescape_uri(ngx.var.request_uri),ngx.unescape_uri(ngx.req.get_body_data()))
-- check()
-- 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 a98018f

Please sign in to comment.