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

Skip sending body and Content-Length for responses with no body #51

Merged
merged 1 commit into from
Nov 5, 2021
Merged

Skip sending body and Content-Length for responses with no body #51

merged 1 commit into from
Nov 5, 2021

Conversation

clue
Copy link
Owner

@clue clue commented Nov 5, 2021

This changeset ensures we explicitly skip any response body when the response body MUST be empty, such as for HEAD requests, 204 No Content and 304 Not Modified. Likewise, any streaming response body will be closed immediately in this case.

On top of this, X now ensures that 204 No Content response never contains a Content-Length response header and 304 Not Modified respects any explicit Content-Length header.

Builds on top of #50 and #48
Builds on top of reactphp/http#429 and reactphp/http#430
Refs tornadoweb/tornado#1736 and ninenines/cowboy#1153

@clue clue added bug Something isn't working new feature New feature or request labels Nov 5, 2021
@clue clue requested a review from SimonFrings November 5, 2021 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants