-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finagle-http: Remove body (and Content-Length) from 1xx, 204 and 304 …
…responses Problem We currently have two problems. Firstly, as described in RFC2616 and RFC7230, 1xx, 204 and 304 responses must not contain a message-body. This requirement was not enforced in finagle, i.e., a message-body can be added. Moreover, a Content-Length header field can be added to 1xx and 204 responses, which is not allowed as mentioned in RFC7230#section-3.3.2. Solution Firstly, we have to clear a message-body, which we call content in finagle, if the response status code is either 1xx, 204 or 304 to satisfy RFC7230. Then, we need to remove a Content-Length header field in 1xx and 204 responses to follow RFC7230#section-3.3.2. With regard to a 304 response, we don't intentionally remove it even though a Content-Length header field is set. Result We follow the specification of RFC with regard to a message-header and message-body except that we have not added some header fields required in a response with status code 304 to satisfy RFC7232#section-4.1; Any of the following header fields must be generated: Cache-Control, Content-Location, Date, ETag, Expires, and Vary. Signed-off-by: Bryce Anderson <banderson@twitter.com> RB_ID=917827
- Loading branch information
1 parent
a106fae
commit 1e4252e
Showing
7 changed files
with
260 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters