Repository navigation
Conversation
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.
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
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 --checkpassed.References
RFC 9112, Section 8.