nginx-upload-module icon indicating copy to clipboard operation
nginx-upload-module copied to clipboard

Invalid POST request will be pass to backend.

Open bigplum opened this issue 14 years ago • 1 comments

If I post an invalid data, like content-length less than content-Range, this module will pass to backend rather than return a 41* error.

test case: curl localhost:8081/upload/ -d abc -H "Content-Type: text/xml" -H "Content-Dispos ition: attachment; filename=big.TXT" -H "X-Content-Range: bytes 6-10/511920" -H "Session-ID: 1111215056"

logs: 2011/04/08 15:26:57 [debug] 5216#0: 19 write: 18, 080E7F46, 3, 6 2011/04/08 15:26:57 [error] 5216#0: *19 file offset at the end of a part 9 does not match the end specified range 6-10 /511920, client: 127.0.0.1, server: localhost, request: "POST /upload/ HTTP/1.1", host: "localhost:8081" 2011/04/08 15:26:57 [debug] 5216#0: *19 test location: "@test" 2011/04/08 15:26:57 [debug] 5216#0: *19 using location: @test "/upload/?" 2011/04/08 15:26:57 [debug] 5216#0: *19 rewrite phase: 2 2011/04/08 15:26:57 [debug] 5216#0: *19 post rewrite phase: 3 2011/04/08 15:26:57 [debug] 5216#0: *19 generic phase: 4 2011/04/08 15:26:57 [debug] 5216#0: *19 generic phase: 5 2011/04/08 15:26:57 [debug] 5216#0: *19 generic phase: 6 2011/04/08 15:26:57 [debug] 5216#0: *19 http init upstream, client timer: 0 2011/04/08 15:26:57 [debug] 5216#0: *19 epoll add event: fd:17 op:3 ev:80000005 2011/04/08 15:26:57 [debug] 5216#0: *19 http script copy: "Host: " 2011/04/08 15:26:57 [debug] 5216#0: *19 http script var: "10.6.2.51" 2011/04/08 15:26:57 [debug] 5216#0: *19 http script copy: "^M " 2011/04/08 15:26:57 [debug] 5216#0: *19 http script copy: "Connection: close^M " 2011/04/08 15:26:57 [debug] 5216#0: *19 http proxy header: "User-Agent: curl/7.21.3 (i686-pc-linux-gnu) libcurl/7.21.3 zlib/1.2.3" 2011/04/08 15:26:57 [debug] 5216#0: *19 http proxy header: "Accept: */" 2011/04/08 15:26:57 [debug] 5216#0: *19 http proxy header: "Content-Type: multipart/form-data; boundary=00000123477" 2011/04/08 15:26:57 [debug] 5216#0: *19 http proxy header: "Content-Disposition: attachment; filename=big.TXT" 2011/04/08 15:26:57 [debug] 5216#0: *19 http proxy header: "X-Content-Range: bytes 6-10/511920" 2011/04/08 15:26:57 [debug] 5216#0: *19 http proxy header: "Session-ID: 1111215056" 2011/04/08 15:26:57 [debug] 5216#0: *19 http proxy header: "Content-Length: 19" 2011/04/08 15:26:57 [debug] 5216#0: *19 http proxy header:

bigplum avatar Apr 08 '11 07:04 bigplum

Indeed it's a bug. I'll fix it little bit later.

vkholodkov avatar Apr 08 '11 09:04 vkholodkov