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

Add Content-Length header for every responses #140

Closed
wants to merge 2 commits into from

Conversation

blmarket
Copy link
Contributor

Motivation:

Currently armeria does not set Content-Length header for last request
of connection, Using 5th rule of RFC 4.4 to indicate transfer-length of the body.

But, RFC 14.13 mentions that application should use Content-Length to indicate
transfer-length, even though 4.4 seems to allow this. also, 14.13
prohibits to send content-length when response should not have entity
body, which armeria did not followed.

Also some clients depend on Content-Length only, which works
incorrectly if no header is provided.

Modifications:

  • Set Content-Length header if response have entity body, regardless
    of connection status.

Result:

More standard-compliant, and it works better with other clients.

@blmarket blmarket force-pushed the feature-content_length branch 2 times, most recently from bf84958 to c0efc88 Compare April 11, 2016 08:13
Motivation:

Currently armeria does not set `Content-Length` header for last request
of connection, Using 5th rule of [RFC 4.4](http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4)
to indicate transfer-length of the body.

But, [RFC 14.13](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13)
mentions that application should use `Content-Length` to indicate
transfer-length, even though 4.4 seems to allow this. also, 14.13
prohibits to send content-length when response should not have entity
body, which armeria did not followed.

Also some clients depend on `Content-Length` only, which works
incorrectly if no header is provided.

Modifications:

- Set `Content-Length` header if response have entity body, regardless
  of connection status.

Result:

More standard-compliant, and it works better with other clients.
@blmarket
Copy link
Contributor Author

This PR is duplicated with #141, will close when it's merged.

@trustin trustin closed this Apr 12, 2016
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.

2 participants