Skip to content

Bun.serve: stream the body for a 307/308 Bun.file() route instead of hanging keep-alive - #35024

Open
robobun wants to merge 3 commits into
mainfrom
farm/1da0a9aa/fix-end-without-body-framing
Open

Bun.serve: stream the body for a 307/308 Bun.file() route instead of hanging keep-alive#35024
robobun wants to merge 3 commits into
mainfrom
farm/1da0a9aa/fix-end-without-body-framing

Bun.serve: frame bodiless file-route responses (205/307/308) on keep-…

159c015
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 22, 2026 in 9m 37s

Code review found 1 potential issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit test/js/bun/http/bun-serve-file.test.ts:1266-1274 Raw-socket helpers wire error to resolve and never wire close — regressions hang instead of failing

Annotations

Check warning on line 1274 in test/js/bun/http/bun-serve-file.test.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

Raw-socket helpers wire error to resolve and never wire close — regressions hang instead of failing

Both raw-socket helpers wire `error` to `resolve(buf)` instead of `reject`, and neither wires `close` — REVIEW.md ('Tests reviewers reject'): *"Wire EVERY failure event (`error`, `close`, `abort`, process exit) to reject the awaited promise"*. In the pipelined-307 block, if a regression makes the server close after the first 307 (e.g. someone swaps this fix for `Connection: close`), node:net emits `end`→`close` — not `error` — so the promise never settles and the test hangs to the file timeout i