Repository navigation
Skip trailer fields after the last chunk, and answer 400 to a bare LF in them - #1950
Merged
Merged
Conversation
nigrosimone
marked this pull request as ready for review
October 2, 2026 06:08
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.
A chunked body with a trailer field gets a 400 (Http11Probe COMP-CHUNKED-TRAILER-VALID, RFC 9112 7.1.2). HttpParser does not pass
trailerto ChunkIterator, so after0\r\nit drops two bytes and parses the rest as a new request.The fix passes
truein the three calls, so the trailer state machine that is already there reads the fields and drops them. Two more lines answer 400 to a bare LF there: without them,0\r\n\nwith a pipelined request after it takes the request as a trailer field and never answers it.The new test sends a valid trailer and two bare LF cases, each one followed by a GET. It fails without the fix and without the two lines.
With Http11Probe locally COMP-CHUNKED-TRAILER-VALID goes from Fail to Pass and SMUG-CHUNK-LF-TRAILER from Warn to Pass. Five unscored SMUG-TRAILER-* tests go from Pass to Warn: they passed only because every trailer got a 400.