1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-05 00:58:47 +02:00

Fix flushing in Gzip middleware (#1317)

* Make Gzip response Writer also call Flush of underlying Writer
* Add unit test for chunked responses with Gzip
This commit is contained in:
Hylke Visser
2019-04-16 23:52:06 +03:00
committed by Vishal Rana
parent e3717be4be
commit 69bd47b35f
2 changed files with 47 additions and 0 deletions

View File

@ -111,6 +111,9 @@ func (w *gzipResponseWriter) Write(b []byte) (int, error) {
func (w *gzipResponseWriter) Flush() {
w.Writer.(*gzip.Writer).Flush()
if flusher, ok := w.ResponseWriter.(http.Flusher); ok {
flusher.Flush()
}
}
func (w *gzipResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {