Skip to content

HTTP client: Fix empty streaming request body, omit Transfer-Encoding: chunked - #516

Merged
WyriHaximus merged 1 commit into
reactphp:1.xfrom
clue-labs:fix-empty-chunked
Feb 26, 2024
Merged

HTTP client: Fix empty streaming request body, omit Transfer-Encoding: chunked#516
WyriHaximus merged 1 commit into
reactphp:1.xfrom
clue-labs:fix-empty-chunked

Conversation

@clue

@clueclue commented Feb 22, 2024

Copy link
Copy Markdown
Member

This changeset fixes sending an outgoing streaming request body that is known to be empty. In this case, we do not want to send a Content-Length: 0 or Transfer-Encoding: chunked. Prior to this change, we would send a Transfer-Encoding: chunked header without ever sending an end chunk, thus never signalling the end of the request body stream to the HTTP server. In other words, the updated version is now compliant with https://www.rfc-editor.org/rfc/rfc9112.html.

Resolves#497

@SimonFringsSimonFrings left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, let's get this in 👍

@WyriHaximusWyriHaximus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@WyriHaximus
WyriHaximus merged commit 7728e0c into reactphp:1.xFeb 26, 2024
@clue
clue deleted the fix-empty-chunked branch February 26, 2024 10:27
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EmptyBodyStream as request body not working

3 participants

@clue@WyriHaximus@SimonFrings