mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-23 01:57:55 +08:00
Merge aca91f1c15348459fa096b23d6bcd03a6fac7aa6 into b7bb9baa642d2b9d5918a5bcd3829dae64c65257
This commit is contained in:
commit
107a0efc06
@ -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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user