From 3d59734b8d00c23a03c7c1aa65bb9d2c6c3a7046 Mon Sep 17 00:00:00 2001 From: hoelee Date: Wed, 10 Jun 2026 16:47:00 +0800 Subject: [PATCH] feat(botfilter): add statusRecorder.Flush --- botfilter.go | 9 +++++++++ 1 file changed, 9 insertions(+) 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() + } +} +