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

HttpServerResponse content headers improvements #2630

Closed
vietj opened this issue Sep 19, 2018 · 0 comments
Closed

HttpServerResponse content headers improvements #2630

vietj opened this issue Sep 19, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@vietj
Copy link
Member

vietj commented Sep 19, 2018

Currently the HttpServerResponse incorrectly sets the content-length and transfer-encoding headers in a few cases. It should use the following rules:

  • on RESET_CONTENT (205) status
    • either send transfer-encoding: chunked with an empty chunk or content-length : 0
  • on HEAD method or NOT_MODIFIED (304) status
    • content-Length should not be set automatically to 0 or this header can be set to what the body size would have been
    • transfer-encoding should not be present
  • on INFORMATIONAL (1xx) or NO_CONTENT (204)
    • none of these headers should be present

Currently a few cases are not supported for HTTP/1.x and HTTP/2. This issues fixes them, in addition the chunked flag on the response implementations is removed to check the transfer-encoding directly on the response to avoid the edge case where a user would set such headers instead of the response object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant