mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-06 07:04:34 -04:00
gzipResponseWriter should also be a Flusher
To be consistent with 3faad41b437c48cea37863123fab425169bc0c6e and c64cf218b0a82d144e779454817eb0371a5002a8
This commit is contained in:
parent
c4e2cf96e7
commit
0a7ca64f53
@ -142,6 +142,16 @@ func (w *gzipResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
|
|||||||
return nil, nil, fmt.Errorf("not a Hijacker")
|
return nil, nil, fmt.Errorf("not a Hijacker")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Flush implements http.Flusher. It simply wraps the underlying
|
||||||
|
// ResponseWriter's Flush method if there is one, or panics.
|
||||||
|
func (w *gzipResponseWriter) Flush() {
|
||||||
|
if f, ok := w.ResponseWriter.(http.Flusher); ok {
|
||||||
|
f.Flush()
|
||||||
|
} else {
|
||||||
|
panic("not a Flusher") // should be recovered at the beginning of middleware stack
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// CloseNotify implements http.CloseNotifier.
|
// CloseNotify implements http.CloseNotifier.
|
||||||
// It just inherits the underlying ResponseWriter's CloseNotify method.
|
// It just inherits the underlying ResponseWriter's CloseNotify method.
|
||||||
func (w *gzipResponseWriter) CloseNotify() <-chan bool {
|
func (w *gzipResponseWriter) CloseNotify() <-chan bool {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user