streaming-form-data icon indicating copy to clipboard operation
streaming-form-data copied to clipboard

MultipleTargets incorrect parsing of multipart_filename - Content-Type mistaken for Content-Disposition after first file

Open RetroErised opened this issue 1 year ago • 1 comments

POST /test HTTP/1.1
Content-Length: 580
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="arguments"

{"primary":"text","importable":false,"extractable":true}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="lang"

zh
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="/D:/Downloads/100m.txt"
Content-Type: text/plain

(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="/D:/Downloads/25m.txt"
Content-Type: text/plain

(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW--

When using MultipleTargets to parse multipart_filename, the first file is parsed correctly. However, for subsequent files, instead of correctly retrieving the Content-Disposition filename, it mistakenly returns the Content-Type, such as text/plain.

RetroErised avatar Mar 20 '25 02:03 RetroErised

Could you post the code snippet of how the parser is being called?

siddhantgoel avatar Mar 28 '25 21:03 siddhantgoel