Skip to content
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

append crlf to formdata body #3625

Merged
merged 2 commits into from
Sep 20, 2024
Merged

Conversation

KhafraDev
Copy link
Member

fixes #3624

this change is harmless. Servers that don't care should ignore it.

@KhafraDev KhafraDev merged commit fdeccc2 into nodejs:main Sep 20, 2024
32 checks passed
@KhafraDev KhafraDev deleted the append-crlf-fd-body branch September 20, 2024 01:27
@github-actions github-actions bot mentioned this pull request Dec 3, 2024
This was referenced Dec 16, 2024
philnash added a commit to philnash/langflow that referenced this pull request Jan 14, 2025
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.
philnash added a commit to philnash/langflow that referenced this pull request Jan 14, 2025
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.
github-merge-queue bot pushed a commit to langflow-ai/langflow that referenced this pull request Jan 21, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When using fetch for FormData upload files, lack of"\r\n"
2 participants