Merge aca91f1c15348459fa096b23d6bcd03a6fac7aa6 into b7bb9baa642d2b9d5918a5bcd3829dae64c65257

This commit is contained in:
Wolfgang Meyers 2018-08-19 16:42:06 +00:00 committed by GitHub
commit 107a0efc06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,7 +105,13 @@ func (w *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
// CloseNotify implements the http.CloseNotify interface. // CloseNotify implements the http.CloseNotify interface.
func (w *responseWriter) CloseNotify() <-chan bool { func (w *responseWriter) CloseNotify() <-chan bool {
return w.ResponseWriter.(http.CloseNotifier).CloseNotify() // Handle ResponseWriters that don't implement CloseNotifier
closeNotifier, ok := w.ResponseWriter.(http.CloseNotifier)
if ok {
return closeNotifier.CloseNotify()
}
// This channel never returns a value
return make(chan bool)
} }
// Flush implements the http.Flush interface. // Flush implements the http.Flush interface.