Skip to content

Commit

Permalink
增加post对上传文件的检测流程
Browse files Browse the repository at this point in the history
  • Loading branch information
loveshell committed Apr 7, 2015
1 parent ae8aa78 commit eaa4055
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions waf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ elseif PostCheck then
return true
end
size = size + len(data)
local m = ngx.re.match(data,'Content-Disposition: form-data;(.+)filename="(.+)\\.(.*)"','ijo')
if m then
fileExtCheck(m[3])
filetranslate = true
else
if ngx.re.find(data,"Content-Disposition:",'isjo') then
filetranslate = false
end
if filetranslate==false then
if body(data) then
return true
end
end
end
local less = content_length - size
if less < chunk_size then
chunk_size = less
Expand Down

0 comments on commit eaa4055

Please sign in to comment.