~bigbes/sr-ht-ecore: 3bd158fb

mcphttp: pin Flush with a flush that precedes any write

Deleting the Flush method left every test in this package green. All of
them wrote before flushing, which commits the headers through the Write
hook and leaves the flush path unmeasured — the second vacuous test in
this file, after the Unwrap one.

The case that needs Flush is a handler that flushes first, as an SSE
handler opening a stream does. It has to run against a real server:
httptest.ResponseRecorder's Header() hands back the live map, so a
recorder reports the headers as set whenever they were set, and passes
for exactly this bug. Found by an agent that measured it in a sibling
service's copy of this code.

Eugene Blikh <bigbes@gmail.com> — 2026-08-16 08:14:11 UTC

Commit 3bd158fbb23241df31897f9ba47afac832ee2e1dview raw patch

Parent(s): 00d75828

1 changed file(s)

FileStatus+
mcphttp/cache_test.go M +38