1
0
mirror of https://github.com/labstack/echo.git synced 2025-02-03 13:11:39 +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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,3 +119,10 @@ func (w *gzipResponseWriter) Flush() {
func (w *gzipResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { func (w *gzipResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
return w.ResponseWriter.(http.Hijacker).Hijack() 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
}