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

Let 307/308 file routes stream the body like every other path

f3644fb
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 22, 2026 in 13m 8s

Code review found 2 potential issues

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

Details

Severity Count
🔴 Important 0
🟡 Nit 2
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/runtime/server/FileRoute.rs:507-520 PR title/description no longer match the implementation (307/308 now stream body, not Content-Length: 0)

Annotations

Check warning on line 520 in src/runtime/server/FileRoute.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

PR title/description no longer match the implementation (307/308 now stream body, not Content-Length: 0)

nit: The PR title ("bodiless file-route responses (205/307/308)") and the description's Fix section ("Write `Content-Length: 0` for 205/307/308 before `end_without_body`") no longer match what commit f3644fb actually landed — 307/308 now fall through to `FileResponseStream` and stream the file body (`Content-Length: 5` in the test), and only 205 gets `Content-Length: 0`. The audit-table row "`FileRoute.rs:511` (205/307/308) — fixed here" is likewise stale. Please re-sync the title/description be