Skip to content

Commit e52e7bf

Browse files
committed
修改了下post处理逻辑
1 parent 6d1286a commit e52e7bf

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

waf.lua

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ else
1212
elseif ngx.var.http_user_agent and ngx.re.match(ngx.var.http_user_agent,regex.."|"..agent,"isjo") then
1313
log('USER-AGENT',ngx.unescape_uri(ngx.var.request_uri))
1414
check()
15-
elseif ngx.req.get_method()=='POST' and ngx.re.match(ngx.unescape_uri(ngx.req.get_body_data()),regex.."|"..post,"isjo") then
15+
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
1616
log('POST',ngx.unescape_uri(ngx.var.request_uri),ngx.unescape_uri(ngx.req.get_body_data()))
17-
check()
18-
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
19-
check()
17+
check()
18+
elseif string.len(filext) >0 then
19+
if ngx.req.get_body_data() and ngx.re.match(ngx.req.get_body_data(),"Content-Disposition: form-data;(.*)filename=\"(.*)."..filext.."\"","isjo") then
20+
check()
21+
end
2022
-- elseif ngx.req.get_headers()["Cookie"] and ngx.re.match(ngx.unescape_uri(ngx.req.get_headers()["Cookie"]),regex,"isjo")then
2123
-- log('COOKIE',ngx.unescape_uri(ngx.var.request_uri),ngx.unescape_uri(ngx.req.get_headers()["Cookie"]))
2224
-- check()

0 commit comments

Comments
 (0)