Repository navigation
Bun.serve: fix HEAD and 204 response framing - #32800
Merged
Merged
Claude / Claude Code Review
completed
Jun 27, 2026 in 27m 43s
Code review found 1 important issue
Found 2 candidates, confirmed 2. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 1 |
| 🟡 Nit | 0 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🔴 Important | src/runtime/server/FileRoute.rs:479-483 |
FileRoute with status 101: Content-Length suppressed but file body still streamed → keep-alive desync |
Annotations
Check failure on line 483 in src/runtime/server/FileRoute.rs
claude / Claude Code Review
FileRoute with status 101: Content-Length suppressed but file body still streamed → keep-alive desync
The same gap exists in `FileRoute` for status 101, which `writeStatus` now also flags as `noBodyStatus` but which is not in this `204 | 205 | 304 | 307 | 308` early-return list. `new Response(Bun.file(p), { status: 101 })` as a static route reaches `write_header_int("content-length", size)` (silently dropped by the new `writeHeader(key, uint64_t)` guard) and then `FileResponseStream::start`, which ships the file bytes via OS sendfile / `HttpResponse::write()` — neither goes through `internalEnd`
Loading