From eaa4055a985a28bc3f74bac9ac4f2c90d15fa50f Mon Sep 17 00:00:00 2001 From: loveshell <82163261@qq.com> Date: Wed, 8 Apr 2015 00:18:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0post=E5=AF=B9=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=96=87=E4=BB=B6=E7=9A=84=E6=A3=80=E6=B5=8B=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- waf.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/waf.lua b/waf.lua index d8e85e7..a6e5fdc 100644 --- a/waf.lua +++ b/waf.lua @@ -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