Repository navigation
Conversation
pjfanning
reviewed
Nov 26, 2026
pjfanning
left a comment
Member
There was a problem hiding this comment.
Fix is correct. Nits:
- Why this went unnoticed: the
RequestParserSpec/ResponseParserSpectrailer cases expectLastChunk(..., List(Foo, Bar)), butStrictEqualHttpRequest/StrictEqualHttpResponsecompare viatoStrict, which drops trailers. A parser-level assertion (or fixing that comparison) would be more targeted than the end-to-end test. - The test comment says repeated lines "are combined", but they aren't.
- The test is in the concrete
ClientServerSpecbody while sibling PRs useClientServerSpecBase.
He-Pin
force-pushed
the
fix/http1-trailer-field-order
branch
from
November 26, 2026 11:58
bf55d90 to
fa20ae2
Compare
pjfanning
reviewed
Nov 26, 2026
pjfanning
left a comment
Member
There was a problem hiding this comment.
Thanks, the parser-level assertion is the right test. One thing left: it is wrapped in if (mode == "CRLF") and builds its input with crlf(...), so it does not run in ResponseParserLFSpec. The fix does not depend on the line ending, so could the test use prep/newLine like its neighbours and run in both modes? (Same point as on #1644.)
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.
Motivation
The HTTP/1 parser collects trailer fields by prepending each field. It used that list directly in the terminal chunk, reversing the received order of repeated list-valued fields.
Modification
Restore received order when constructing the terminal chunk. Assert the ordered trailer list directly on the
LastChunkproduced by the HTTP/1.1 response parser, without converting the entity to strict.Result
The trailer sequence follows the received order. Rendering, the empty terminal chunk, and public signatures are unchanged.
Tests
JDK 17: the focused native
ResponseParserSpeccase passed on Scala 2.13.18 and 3.3.9 (1/1 each). The Scala 2 baseline failed on reversed trailer order as expected. Scoped formatting and license-header checks passed; no full CI run.References
None - RFC 9110 §5.3 and §6.5.2.