之前一直用1.2.3.8里面的lua-resty-upload,用curl提交一直没问题,类似下面的
curl -F "file=@./1.jpg;filename=1.jpg" "http://xx.xx.xx.xx/upload?file=xxxx&md5=yyyy"
对lua-resty-upload代码的使用与其示例中基本一致。
昨天下了1.2.4.14,正常./configure --lua-jit && make && make install
今天再试的时候,出错
"no boundary defined in Content-Type"
curl -v抓到的http头正常
> POST /upload?upload?file=xxxx&md5=yyyy HTTP/1.1
> Host: xx.xx.xx.xx
> Accept: */*
> Content-Length: 558638
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=----------------------------7ccf938aea2f
>
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< Server: ngx_openresty
< Date: Sat, 29 Dec 2012 07:40:37 GMT
< Content-Type: text/html
< Transfer-Encoding: chunked
< Connection: keep-alive
========== 分隔栏 =============
找到upload.lua代码,把
local function get_boundary()
local header = get_headers().content_type
改成
local function get_boundary()
local header = get_headers()["Content-Type"]
后,curl提交成功。
没有再深究,是不是ngx_lua的模块改动导致的?请教各位大大!!!先行感谢!!!