1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-15 01:34:53 +02:00

make gzipResponseWriter implement http.Pusher (#1615)

This commit is contained in:
Shinnosuke Sawada
2020-08-04 09:58:08 +09:00
committed by GitHub
parent d3245067e0
commit 8dd25c39ce

View File

@ -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
}