libvmod-parsereq icon indicating copy to clipboard operation
libvmod-parsereq copied to clipboard

Bug in decodeForm_multipart

Open 4ft35t opened this issue 11 years ago • 4 comments

When upload a file, after decodeForm_multipart, the boundary in the end was missing. The backend can't recognize the file content.

a original request

Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryKhBLOcZmZJPu7wsF


------WebKitFormBoundaryKhBLOcZmZJPu7wsF
Content-Disposition: form-data; name="file"; filename="1.jpg"
Content-Type: image/jpeg

file content

------WebKitFormBoundaryKhBLOcZmZJPu7wsF--

after decodeForm_multipart

Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryKhBLOcZmZJPu7wsF


------WebKitFormBoundaryKhBLOcZmZJPu7wsF
Content-Disposition: form-data; name="file"; filename="1.jpg"
Content-Type: image/jpeg

file content    

4ft35t avatar Jul 18 '13 13:07 4ft35t

I've looking for bugs. But, I can't reproduce the error.

Please tell me your

  • varnish param (sess_workspace, thread_pool_workspace)
  • VCL
  • upload file size
  • HTML form
  • error code ( https://github.com/xcir/libvmod-parsereq#errcode )
  • syslog output ( replace parsereq.init() -> parsereq.debuginit() / Latest edition)

xcir avatar Aug 04 '13 17:08 xcir

  • varnish 3.03, we have add some function ,not about HTTP.libvmod-parsereq 0.11

  • vcl

    sub vcl_recv { some_backend_check; parsereq.init(); do_some_param_check; }

  • upload file size

    a 81 KB jpg image

  • HTML form, all the "<" deleted

    form action="http://a.b.com/upload.php" enctype="MULTIPART/FORM-DATA" method=post>

input type="hidden" name="token" value="aaaaaaa"> chose the file input type="file" name="file" />

input type="submit" value="上载" />

/form>

  • error code 1
  • syslog output, I use parsereq.debuginit() instead parsereq.init(), but nothing output in syslog

4ft35t avatar Aug 05 '13 05:08 4ft35t

thanks!

sorry, I have additional question. your system is 32bit or 64bit?

syslog output, I use parsereq.debuginit() instead parsereq.init(), but nothing output in syslog

This function enabled by last commit. Could you update your vmod?

xcir avatar Aug 05 '13 17:08 xcir

I can't reproduce the error. (commit:2344675e1741a6e8f05c4acdfd18ae2a4bfbd70d)

xcir avatar Aug 11 '13 09:08 xcir