feat(botfilter): add statusRecorder.Flush
This commit is contained in:
1 parent
394276ca28
commit
3d59734b8d
1 file changed
+9
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user