diff --git a/botfilter.go b/botfilter.go index fc097539..8318ca7e 100644 --- a/botfilter.go +++ b/botfilter.go @@ -129,3 +129,12 @@ func (r *statusRecorder) statusCode() int { func (r *statusRecorder) Unwrap() http.ResponseWriter { return r.ResponseWriter } +func (r *statusRecorder) Flush() { + if r.status == 0 { + r.status = http.StatusOK + } + if flusher, ok := r.ResponseWriter.(http.Flusher); ok { + flusher.Flush() + } +} +