Skip to content

test: cover HTTP/1 response trailers without body data - #1623

Merged
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:test/http1-trailer-without-body-data
Nov 26, 2026
Merged

He-Pin merged 1 commit into
apache:mainfrom
He-Pin:test/http1-trailer-without-body-data

Conversation

@He-Pin

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

Copy link
Copy Markdown
Member

Motivation

An HTTP/1.1 chunked response can carry trailing metadata without carrying body bytes.

Modification

Use the standard typed server and client to send a 200 response whose only entity element is a declared application trailer. Drain the public chunk stream and check that it contains exactly the expected terminal chunk.

Result

The test checks that the client preserves that trailer without emitting any body chunk. No production change.

Tests

On JDK 17, the focused ClientServerSpec case passed on Scala 2.13.18 and 3.3.9 (1/1 each). It runs only in the HTTP/1.1 suite. Scoped formatting, license-header and whitespace checks passed; no full CI run.

References

Refs #1619 and #1620 for adjacent tests. RFC 9112 §7.1.2 and RFC 9110 §6.5.

@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.

Nits: largely overlaps #1620's test and could be folded into it as a second case. Also in ClientServerSpecBase, so it runs a redundant second time in the HTTP/2-enabled spec.

@He-Pin
He-Pin force-pushed the test/http1-trailer-without-body-data branch from 787d394 to 7192684 Compare November 26, 2026 13:00
@He-Pin
He-Pin requested a review from pjfanning November 26, 2026 13:01

@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:
Keep a regression for a chunked HTTP/1.1 response that carries trailer fields without data chunks.

Modification:
Add the trailer-only exchange to the existing HTTP/1.1 suite alongside the body-bearing trailer test.

Result:
The focused client/server tests assert the final trailer fields with and without body data.

References:
apache#1623; RFC 9110 Section 6.5; RFC 9112 Section 7.1.2.
@He-Pin
He-Pin force-pushed the test/http1-trailer-without-body-data branch from 7192684 to 0ea6068 Compare November 26, 2026 19:44
@He-Pin
He-Pin merged commit 7bf1e6a into apache:main Nov 26, 2026
6 checks passed
@He-Pin
He-Pin deleted the test/http1-trailer-without-body-data branch November 26, 2026 20:13
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