Skip to content

test: cover HTTP/1 request chunk extension round-trip - #1655

Open
He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:test/http1-request-chunk-extensions
Open

He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:test/http1-request-chunk-extensions

Conversation

@He-Pin

@He-Pin He-Pin commented Nov 26, 2026

Copy link
Copy Markdown
Member

Motivation

The existing HTTP/1.1 request round-trip exercises bare chunks, so it cannot detect losing application-visible chunk extensions.

Modification

Send a modeled chunked POST whose first data chunk has two token-valued extension entries. Compare the server application's complete typed request chunk stream, including the unadorned second data chunk and the final chunk. Keep the response-body and connection-completion assertions with a regular 200 response.

Result

The native round-trip checks request metadata and data together without changing production behavior or the public API.

Tests

JDK 17; focused ClientServerSpec and ClientServerHttp2EnabledSpec passed on Scala 2.13.18 and 3.3.9 (2/2 each, both using HTTP/1.1). Scoped test Scalafmt and license-header checks passed.

References

### Motivation

The existing HTTP/1.1 request round-trip exercises bare chunks, so it cannot detect losing application-visible chunk extensions.

### Modification

Send a modeled chunked POST whose first data chunk has two token-valued extension entries. Compare the server application's complete typed request chunk stream, including the unadorned second data chunk and the final chunk. Keep the response-body and connection-completion assertions with a regular 200 response.

### Result

The native round-trip checks request metadata and data together without changing production behavior or the public API.

### Tests

JDK 17; focused ClientServerSpec and ClientServerHttp2EnabledSpec passed on Scala 2.13.18 and 3.3.9 (2/2 each, both using HTTP/1.1). Scoped test Scalafmt and license-header checks passed.

### References

- [RFC 9112 §7.1.1](https://www.rfc-editor.org/rfc/rfc9112.html#section-7.1.1)
- [Netty's multiple token-valued request extension test](https://github.com/netty/netty/blob/fd00bc3a2a02a614fca8241d16570801a3a08314/codec-http/src/test/java/io/netty/handler/codec/http/HttpRequestDecoderTest.java#L1029-L1054)
@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.

Useful coverage. Nits:

  • It rewrites the existing "properly complete a chunked request/response cycle" test rather than adding a new one.
  • 206/PartialContent → OK is unrelated churn.

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