From e1b47b69aa4f050735729bff1216fe61583ceb31 Mon Sep 17 00:00:00 2001 From: Owen Date: Thu, 6 Aug 2026 17:14:35 -0400 Subject: [PATCH] expose unwrap to allow for streaming --- main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.go b/main.go index d5508e6..d1c350d 100644 --- a/main.go +++ b/main.go @@ -273,6 +273,16 @@ func (w *responseWriterWrapper) WriteHeader(statusCode int) { w.ResponseWriter.WriteHeader(statusCode) } +// Unwrap exposes the underlying ResponseWriter so http.ResponseController +// (used by httputil.ReverseProxy's streaming Flush, and by Hijack/Push +// callers) can see through this wrapper to the real http.Flusher etc. +// Without this, ReverseProxy's flushes on /router/* silently no-op and +// streamed responses (e.g. SSE) get buffered until the response completes +// instead of being forwarded incrementally. +func (w *responseWriterWrapper) Unwrap() http.ResponseWriter { + return w.ResponseWriter +} + func parseLogLevel(level string) logger.LogLevel { switch strings.ToUpper(level) { case "DEBUG":