diff --git a/internal/logging/middleware.go b/internal/logging/middleware.go index 120a6bb..7dd847c 100644 --- a/internal/logging/middleware.go +++ b/internal/logging/middleware.go @@ -33,6 +33,13 @@ func (rw *responseWriter) Write(b []byte) (int, error) { return n, err } +// Flush implements http.Flusher, required for SSE streaming through middleware chains. +func (rw *responseWriter) Flush() { + if f, ok := rw.ResponseWriter.(http.Flusher); ok { + f.Flush() + } +} + // Unwrap returns the original http.ResponseWriter, required for http.ResponseController. func (rw *responseWriter) Unwrap() http.ResponseWriter { return rw.ResponseWriter