mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-10 10:35:51 +00:00
71347eac4c
A handler that flushes before its first write commits the response headers with an implicit 200. The gzip wrapper deferred its compress-or-not decision to the first write, so such a handler would send headers without Content-Encoding and then a compressed body, which clients cannot decode. Every current flusher is an SSE handler whose content type never compresses, so this was latent, but any future streaming JSON endpoint would have corrupted silently. Flush now runs the decision first, matching net/http header-commit semantics.