SSE requires being able to flush the response stream as each message is written. Response buffering gets in the way of this -- the messages will be flushed into the buffer, but the client won't see any of them until the response is closed.
To support SSE while allowing the use of response buffering elsewhere, we can add a bypass for responses that have Content-Type: text/event-stream that prevents them being buffered.
We'll also need to make sure that any custom ResponseWriters in the handler are Flush-able.
SSE requires being able to flush the response stream as each message is written. Response buffering gets in the way of this -- the messages will be flushed into the buffer, but the client won't see any of them until the response is closed.
To support SSE while allowing the use of response buffering elsewhere, we can add a bypass for responses that have
Content-Type: text/event-stream
that prevents them being buffered.We'll also need to make sure that any custom
ResponseWriter
s in the handler areFlush
-able.Fixes #34.