Summary
HEAD requests to streaming routes return the full body (server.ts:334-343 handles HEAD only on the sync path).
Impact
A HEAD probe against a streaming route returns the full body instead of just headers, defeating the point of HEAD and wasting bandwidth (and breaking any client/monitor that expects HEAD to be cheap).
Evidence
src/server.ts:334-343 — HEAD handling covers only the sync render path
Suggested fix
Short-circuit HEAD on the streaming path too: run the route match (for status/headers), but don't flush the body. Reuse the same HEAD handler across both paths.
From the AUDIT.md "Low-hanging" list.
Summary
HEAD requests to streaming routes return the full body (
server.ts:334-343handles HEAD only on the sync path).Impact
A HEAD probe against a streaming route returns the full body instead of just headers, defeating the point of HEAD and wasting bandwidth (and breaking any client/monitor that expects HEAD to be cheap).
Evidence
src/server.ts:334-343— HEAD handling covers only the sync render pathSuggested fix
Short-circuit HEAD on the streaming path too: run the route match (for status/headers), but don't flush the body. Reuse the same HEAD handler across both paths.
From the
AUDIT.md"Low-hanging" list.