-
Notifications
You must be signed in to change notification settings - Fork 540
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
When using fetch for FormData upload files, lack of"\r\n" #3624
Comments
A multipart/form-data body is defined as
After a cursory glance in the fetch and xhr specs, along with rfc7578, I couldn't find anywhere that mentioned the serialization process requiring a body end with \r\n. |
@nodejs/web-standards if anyone else wants to take a look. |
Found a piece of information on this。 |
axios adds two \r\n at the end of the footer, which could be legacy behavior or trying to bypass issues like these. https://github.com/axios/axios/blob/1472163d373dda71f74e86365ee2f298d922f5db/lib/helpers/formDataToStream.js#L78 |
Version
v20.14.0
Platform
Subsystem
No response
What steps will reproduce the bug?
The cookie here may have expired
Using axios can smoothly upload pictures, using fetch will prompt the picture error,By grabbing the package, I found that the loss at the end of the fetch was lost at the end of the upload"\r\n"
Missing "0d 0a 0d 0a" =>"\r\n\r\n"
How often does it reproduce? Is there a required condition?
Every time
What is the expected behavior? Why is that the expected behavior?
Tail needs“0d0a”
What do you see instead?
Tail needs“0d0a”
Additional information
No response
The text was updated successfully, but these errors were encountered: