From 4ead8a46006c5a66dc29811c2955195defaa9242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20P=C3=A9rez?= Date: Mon, 25 Nov 2024 11:09:39 +0100 Subject: [PATCH] add flusher interface and implementation --- ron.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ron.go b/ron.go index 9778111..2f9e846 100644 --- a/ron.go +++ b/ron.go @@ -22,6 +22,7 @@ type ( responseWriterWrapper struct { http.ResponseWriter + http.Flusher headerWritten bool } @@ -76,6 +77,10 @@ func (w *responseWriterWrapper) Write(b []byte) (int, error) { return w.ResponseWriter.Write(b) } +func (w *responseWriterWrapper) Flush() { + w.ResponseWriter.(http.Flusher).Flush() +} + func defaultEngine() *Engine { return &Engine{ mux: http.NewServeMux(),