Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow multipart/form-data boundary to end with a newline
The RFC 7578 spec for multipart/form-data requests does not require the body of a request to end with a CRLF, only that each section begins with a CRLF. While many clients implement multipart requests with the trailing CRLF, the implementation for fetch in Node.js version 22 and below does not. This caused my a good number of hours debugging! It does turn out that in September 2024 the Node.js fetch implementation added the CRLF (nodejs/undici#3625), though this hasn't made it to a Node.js release yet. This change allows the boundary to end with a newline or not, as long as the boundary is followed by the end of the request body.
- Loading branch information