Skip to content

Conversation

@kevinmcconnell
Copy link
Collaborator

When using custom response writers in middleware, we need to ensure they all implement http.Flusher. Otherwise, the resulting handler will not be flushable, which means the reverse proxy has no way to flush response content to the client.

Not being able to flush content breaks response types like SSE, which depend on sending chunked data as it happens, rather than buffering it all to the end.

Fixes #47

When using custom response writers in middleware, we need to ensure they
all implement `http.Flusher`. Otherwise, the resulting handler will not
be flushable, which means the reverse proxy has no way to flush response
content to the client.

Not being able to flush content breaks response types like SSE, which
depend on sending chunked data as it happens, rather than buffering it
all to the end.
@kevinmcconnell kevinmcconnell merged commit 92f4ff6 into main Aug 5, 2025
5 checks passed
@kevinmcconnell kevinmcconnell deleted the prevent-response-buffering branch August 5, 2025 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transfer-Encoding header lost with EventSource

2 participants