mirror of
https://github.com/gin-gonic/gin.git
synced 2025-12-31 01:07:34 +08:00
chore(response): prevent Flush() panic when http.Flusher (#4479)
This commit is contained in:
parent
22c274c84b
commit
26c3a62865
@ -128,7 +128,9 @@ func (w *responseWriter) CloseNotify() <-chan bool {
|
|||||||
// Flush implements the http.Flusher interface.
|
// Flush implements the http.Flusher interface.
|
||||||
func (w *responseWriter) Flush() {
|
func (w *responseWriter) Flush() {
|
||||||
w.WriteHeaderNow()
|
w.WriteHeaderNow()
|
||||||
w.ResponseWriter.(http.Flusher).Flush()
|
if f, ok := w.ResponseWriter.(http.Flusher); ok {
|
||||||
|
f.Flush()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *responseWriter) Pusher() (pusher http.Pusher) {
|
func (w *responseWriter) Pusher() (pusher http.Pusher) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user