Skip to content

Conversation

@serixscorpio
Copy link
Contributor

When building a StreamingMultipartBody, the streaming body should produce same content as non-streamining. The following example shows the header for the first_name part (a non-file part) is missing a clrf before the part's content starts. I think this explains the 400 error described in #832 .

==== Before: no extra blank line between "first_name" and John ====

--test-boundary-123
Content-Disposition: form-data; name="avatar"; filename="tiny.gif" Content-Type: image/gif

GIF89a,;
--test-boundary-123
Content-Disposition: form-data; name="first_name"
John
--test-boundary-123

The fix adds a trailing clrf to a non-file part's header:

==== After: notice the extra blank line between "first_name" and John ====

--test-boundary-123
Content-Disposition: form-data; name="avatar"; filename="tiny.gif" Content-Type: image/gif

GIF89a,;
--test-boundary-123
Content-Disposition: form-data; name="first_name"

John
--test-boundary-123

The Before/After outputs are generated by adding puts streaming_content to the updated streaming body produces same content as non-streaming test.

When building a `StreamingMultipartBody`, the following example shows the
header for the `first_name` part should be followed by a clrf before the
part's content starts.

==== Before ====
--test-boundary-123
Content-Disposition: form-data; name="avatar"; filename="tiny.gif"
Content-Type: image/gif

GIF89a,;
--test-boundary-123
Content-Disposition: form-data; name="first_name"
John
--test-boundary-123

==== After ====
--test-boundary-123
Content-Disposition: form-data; name="avatar"; filename="tiny.gif"
Content-Type: image/gif

GIF89a,;
--test-boundary-123
Content-Disposition: form-data; name="first_name"

John
--test-boundary-123
@chaadow
Copy link

chaadow commented Jan 6, 2026

Any chance this gets merged 🙏🏼 ?

@serixscorpio
Copy link
Contributor Author

The CI build for 3.4 failed due to (I think) bad timing. The test diff shows the timestamp to be off by 1 second.

image

Maybe rerun the CI to see if we get a green?

@jnunemaker jnunemaker merged commit 06d4363 into jnunemaker:main Jan 6, 2026
0 of 6 checks passed
@chaadow
Copy link

chaadow commented Jan 10, 2026

is it possible to cut a release please @jnunemaker 🙏🏼

@augustocbx
Copy link

Waiting for it too. 🙏🏼

@jtgrenz
Copy link

jtgrenz commented Jan 14, 2026

related #834

@jnunemaker
Copy link
Owner

It's out.

@jtgrenz
Copy link

jtgrenz commented Jan 15, 2026

huzah! thanks @jnunemaker and @serixscorpio!

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.

5 participants