Skip to content

fix(http): preserve keep-alive after reading request body - #36690

Merged
nathanwhit merged 1 commit into
denoland:mainfrom
nathanwhit:fix/http1-body-keep-alive
Aug 25, 2026
Merged

nathanwhit merged 1 commit into
denoland:mainfrom
nathanwhit:fix/http1-body-keep-alive

Conversation

@nathanwhit

Copy link
Copy Markdown
Member

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.

@nathanwhit
nathanwhit merged commit acc8c6f into denoland:main Aug 25, 2026
136 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant