Skip to content

Commit

Permalink
make gzipResponseWriter implement http.Pusher (labstack#1615)
Browse files Browse the repository at this point in the history
  • Loading branch information
Warashi committed Aug 4, 2020
1 parent d324506 commit 8dd25c3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions middleware/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,10 @@ func (w *gzipResponseWriter) Flush() {
func (w *gzipResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
return w.ResponseWriter.(http.Hijacker).Hijack()
}

func (w *gzipResponseWriter) Push(target string, opts *http.PushOptions) error {
if p, ok := w.ResponseWriter.(http.Pusher); ok {
return p.Push(target, opts)
}
return http.ErrNotSupported
}

0 comments on commit 8dd25c3

Please sign in to comment.