gin.responseWriter implements http.Flusher and http.CloseNotifier
This commit is contained in:
		@ -12,6 +12,9 @@ type (
 | 
				
			|||||||
	ResponseWriter interface {
 | 
						ResponseWriter interface {
 | 
				
			||||||
		http.ResponseWriter
 | 
							http.ResponseWriter
 | 
				
			||||||
		http.Hijacker
 | 
							http.Hijacker
 | 
				
			||||||
 | 
							http.Flusher
 | 
				
			||||||
 | 
							http.CloseNotifier
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Status() int
 | 
							Status() int
 | 
				
			||||||
		Written() bool
 | 
							Written() bool
 | 
				
			||||||
		WriteHeaderNow()
 | 
							WriteHeaderNow()
 | 
				
			||||||
@ -67,3 +70,16 @@ func (w *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	return hijacker.Hijack()
 | 
						return hijacker.Hijack()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Implements the http.CloseNotify interface
 | 
				
			||||||
 | 
					func (w *responseWriter) CloseNotify() <-chan bool {
 | 
				
			||||||
 | 
						return w.ResponseWriter.(http.CloseNotifier).CloseNotify()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Implements the http.Flush interface
 | 
				
			||||||
 | 
					func (w *responseWriter) Flush() {
 | 
				
			||||||
 | 
						flusher, ok := w.ResponseWriter.(http.Flusher)
 | 
				
			||||||
 | 
						if ok {
 | 
				
			||||||
 | 
							flusher.Flush()
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user