add flusher interface and implementation
This commit is contained in:
@@ -22,6 +22,7 @@ type (
|
||||
|
||||
responseWriterWrapper struct {
|
||||
http.ResponseWriter
|
||||
http.Flusher
|
||||
headerWritten bool
|
||||
}
|
||||
|
||||
@@ -76,6 +77,10 @@ func (w *responseWriterWrapper) Write(b []byte) (int, error) {
|
||||
return w.ResponseWriter.Write(b)
|
||||
}
|
||||
|
||||
func (w *responseWriterWrapper) Flush() {
|
||||
w.ResponseWriter.(http.Flusher).Flush()
|
||||
}
|
||||
|
||||
func defaultEngine() *Engine {
|
||||
return &Engine{
|
||||
mux: http.NewServeMux(),
|
||||
|
||||
Reference in New Issue
Block a user