Skip to content

test: cover HTTP/1 client EOF before the first response chunk - #1679

Open
He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:test/http1-client-eof-before-first-chunk
Open

He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:test/http1-client-eof-before-first-chunk

Conversation

@He-Pin

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

Copy link
Copy Markdown
Member

Motivation

An HTTP/1 response may deliver its headers before the server writes any body chunks. A peer close at that point must not be reported to the application as a complete empty entity.

Modification

Use the normal server renderer to produce the headers of a typed response with a pending body. After the client receives the response and subscribes to the entity, complete the peer input and assert that the entity stream fails.

Result

The client test distinguishes an incomplete chunked entity from a successful empty response. Production behavior is unchanged.

Tests

Five focused client cases passed on Scala 2.13.18 and 3.3.9 with JDK 17. An independent run passed the new case and two neighboring cases on each Scala version. Scoped Scalafmt and git diff --check passed.

References

RFC 9112, Section 8.

Motivation:
A chunked response can reach the client header-first and lose the
connection before the application writes any body chunks.

Modification:
Render a normal typed response with a pending body and deliver its
headers through the connection-level test harness. Close the peer input
and assert that the exposed entity stream fails without emitting a chunk.

Result:
The test distinguishes incomplete entities from successful empty
responses. Production behavior is unchanged.

Tests:
- Five focused client cases passed on Scala 2.13.18 and 3.3.9 with JDK 17.
- Scoped Scalafmt and git diff --check passed.

References:
RFC 9112 section 8, Handling Incomplete Messages.
@He-Pin
He-Pin requested a review from pjfanning November 26, 2026 23:32
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.

1 participant