-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work with utf-8 headers #15
Comments
Even if i change the name= value to an ASCII one it fails. |
It seems the issue is here ts-multipart-parser/src/parseMessage.ts Line 62 in 598fb44
|
Thank you for the report and the documentation. I'll take a look and see if / how this can be resolved. It is my understanding that UTF-8 is generally not allowed in headers, although the link you provide seems to show that it's ambiguous. If the issue is with the
Well, what can be done right now is not using non-ASCII values, but obviously that's not ideal. I'll investigate this and try to find a longer term solution. |
I think your library does exactly what it should do. The client is somehow responsible to encode those values in a proper way. There is https://datatracker.ietf.org/doc/html/rfc2231 and https://datatracker.ietf.org/doc/html/rfc6266#section-4.3 It seems many clients do not behave properly. UTF-8 per se is not allowed in headers. There is also this nice test page with all kind of combinations http://test.greenbytes.de/tech/tc2231/#encoding-2231-fb I am not sure if the lib should fix wrong client behaviour but it would be nice if we could some preprocess the header and hand it back to the lib. So as a consumer i could try to fix the header and return a correct value. Another way would be to convert all the headers values to latin1 and as a consumer i need to convert it back to utf-8. I am also not sure what is the best way. |
Hi @brupxxxlgroup, I was wondering if you could provide a reproducible way to test this. The examples provided are already useful, but I want to know how to get those payloads "in the wild". Ideally, a simple HTML with inline JavaScript get different results in different values in browsers would be useful. Save that, a list of steps to reproduce would be the next best. Example:
|
Given the following simple HTTP multipart/form-data upload
the lib will fail with
What can be done about it? Thank you so much for your help.
The text was updated successfully, but these errors were encountered: