libvmod-parsereq
libvmod-parsereq copied to clipboard
Bug in decodeForm_multipart
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
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)
-
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
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?
I can't reproduce the error. (commit:2344675e1741a6e8f05c4acdfd18ae2a4bfbd70d)