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

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

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

clue
Copy link
Member

@clue clue commented Feb 22, 2024

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

Copy link
Member

@SimonFrings SimonFrings left a comment

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 👍

Copy link
Member

@WyriHaximus WyriHaximus left a comment

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.x Feb 26, 2024
14 checks passed
@clue clue deleted the fix-empty-chunked branch February 26, 2024 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EmptyBodyStream as request body not working
3 participants