Repository navigation
fix(http): preserve keep-alive after reading request body - #36690
Merged
Merged
Conversation
bartlomieju
pushed a commit
that referenced
this pull request
Aug 27, 2026
Fixes #36657. The raw HTTP/1 server path treated every non-prebuffered request body as non-reusable, even after JavaScript had reached end-of-stream. Track when the JS reader finishes, preserve keep-alive only after the reader releases the connection, and drain any cancelled remainder before parsing the next pipelined request. Unread and in-flight bodies still close the connection. Tests: - `cargo build --bin deno` - `cargo test -p deno_http_h1` - `tests/unit/serve_test.ts` - scoped Clippy and formatting checks AI disclosure: This change was developed with assistance from OpenAI Codex.
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.
Fixes #36657.
The raw HTTP/1 server path treated every non-prebuffered request body as non-reusable, even after JavaScript had reached end-of-stream. Track when the JS reader finishes, preserve keep-alive only after the reader releases the connection, and drain any cancelled remainder before parsing the next pipelined request. Unread and in-flight bodies still close the connection.
Tests:
cargo build --bin denocargo test -p deno_http_h1tests/unit/serve_test.tsAI disclosure: This change was developed with assistance from OpenAI Codex.