Commit 08fd912
committed
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.1 parent e7a2005 commit 08fd912
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
| 188 | + | |
187 | 189 | | |
| 190 | + | |
188 | 191 | | |
189 | | - | |
| 192 | + | |
190 | 193 | | |
191 | 194 | | |
192 | 195 | | |
| |||
0 commit comments