mirror of
https://github.com/gin-gonic/gin.git
synced 2026-06-27 20:48:24 +08:00
fix(4460): prevent Flush() panic when http.Flusher is not implemented
This commit is contained in:
parent
d1a15347b1
commit
a36555ba8f
@ -128,7 +128,9 @@ func (w *responseWriter) CloseNotify() <-chan bool {
|
||||
// Flush implements the http.Flusher interface.
|
||||
func (w *responseWriter) Flush() {
|
||||
w.WriteHeaderNow()
|
||||
w.ResponseWriter.(http.Flusher).Flush()
|
||||
if f, ok := w.ResponseWriter.(http.Flusher); ok {
|
||||
f.Flush()
|
||||
}
|
||||
}
|
||||
|
||||
func (w *responseWriter) Pusher() (pusher http.Pusher) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user