Fix response chunk encoding.#106
Merged
Merged
Conversation
When using transfer-encoding: chunked, each chunk that's sent over the wire needs to be terminated with \r\n.
seliopou
reviewed
Mar 3, 2019
| write_chunk_length t.encoder length; | ||
| schedule_fixed t iovecs | ||
| schedule_fixed t iovecs; | ||
| write_crlf t.encoder |
Member
There was a problem hiding this comment.
This is used to write the final empty chunk. With the change it will write to CRLFs to it, which isn't correct.
Member
There was a problem hiding this comment.
According to the spec this is actually the correct behavior.
Contributor
Author
There was a problem hiding this comment.
Yeah, I thought it was as well. It's consistent with the format of other chunks - one CRLF following the (0) size and one CRLF following the (empty) block of data.
Member
|
@dpatti can you take a look and confirm that this matches the spec? |
Collaborator
|
Yup, this looks right. I guess I haven't used chunked encoding on the server-side of things yet. Thanks Bogdan! |
seliopou
added a commit
that referenced
this pull request
Apr 5, 2019
The last chunk of a chunk-encoded body was not being properly parsed. Specifically, the final eol was not being consumed. This is the other side of the same coin fixed in #106.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using transfer-encoding: chunked, each chunk that's sent over the
wire needs to be terminated with \r\n.