Skip to content

test: cover HTTP/1 repeated request field value order - #1624

Merged
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:test/http1-request-field-value-order
Nov 26, 2026
Merged

He-Pin merged 1 commit into
apache:mainfrom
He-Pin:test/http1-request-field-value-order

Conversation

@He-Pin

@He-Pin He-Pin commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Motivation

HTTP preserves the relative value order of a repeated list-valued field. Existing client/server tests do not assert that order for a standard HTTP/1.1 POST.

Modification

Use the stock client and server with a normal fixed-length POST. Verify the values of the selected application field in order, the request entity length, and its exact body.

Result

The test does not require a particular order between different field names or prevent combining same-name field lines. No production change.

Tests

JDK 17: both ClientServerSpec and ClientServerHttp2EnabledSpec were selected for the focused native runs. This case ran only in the concrete HTTP/1.1 ClientServerSpec and passed once on each Scala version (2.13.18 and 3.3.9, 1/1 each). Scoped formatting and license-header checks passed. No full CI run.

References

RFC 9110 §5.3 and §9.3.3. Inspired by Netty's decoder test.

@He-Pin
He-Pin requested a review from pjfanning November 26, 2026 08:47

@pjfanning pjfanning left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine, though low value: header lines are collected into a ListBuffer in HttpMessageParser, and RequestParserSpec already compares header lists in order. Nit: in ClientServerSpecBase, so it runs twice.

@He-Pin
He-Pin force-pushed the test/http1-request-field-value-order branch from 96cdbe9 to 8376ef0 Compare November 26, 2026 12:08
@He-Pin
He-Pin requested a review from pjfanning November 26, 2026 12:09

@pjfanning pjfanning left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Motivation:
The HTTP/1.1 loopback suite should verify same-name request field order across client rendering and server parsing.

Modification:
Add the approved typed POST test inside the existing HTTP/1.1 test group. Preserve the existing request and response scenarios unchanged.

Result:
The test asserts the received field values in original logical order together with the HTTP version and the complete request body.

References:
Apache Pekko HTTP apache#1624; RFC 9110 Section 5.3.
@He-Pin
He-Pin force-pushed the test/http1-request-field-value-order branch from 8376ef0 to ef84eb5 Compare November 26, 2026 20:21
@He-Pin
He-Pin merged commit 55db93d into apache:main Nov 26, 2026
6 checks passed
@He-Pin
He-Pin deleted the test/http1-request-field-value-order branch November 26, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants