Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

Fallthrough to embedded responsewriter's httpFlusher interface - #53

Open
Rhionin wants to merge 1 commit into
miekg:masterfrom
Rhionin:master
Open

Fallthrough to embedded responsewriter's httpFlusher interface#53
Rhionin wants to merge 1 commit into
miekg:masterfrom
Rhionin:master

Conversation

@Rhionin

@Rhionin Rhionin commented Jun 19, 2019

Copy link
Copy Markdown

This plugin breaks server-sent events proxying through caddy, because it breaks the httpFlusher interface and makes responses hang with a buffer. This change implements httpFlusher on the timedResponseWriter as a fallthrough to the embedded responsewriter, or no-op if unavailable.

@hairyhenderson

Copy link
Copy Markdown
Collaborator

@Rhionin what's the error that you see without this fix?

@lou-lan

lou-lan commented Sep 9, 2019

Copy link
Copy Markdown

@Rhionin log error example ?

panic: *metrics.timedResponseWriterHijacker is not a flusher

@Rhionin

Rhionin commented Sep 19, 2019

Copy link
Copy Markdown
Author

Hi, sorry for the long delay in replying. The error I see is that flushing the response buffer silently gets stuck at this misleading middleware, because it wraps the original response writer and makes the Flush interface become unavailable. I was encountering this when proxying server-sent events (SSE) through a caddy instance

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants