From 9b61040eee2a5fda842ac09b234a67127eefdd62 Mon Sep 17 00:00:00 2001 From: hoelee Date: Wed, 10 Jun 2026 17:54:00 +0800 Subject: [PATCH] feat(botfilter): add statusRecorder.Hijack --- botfilter.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/botfilter.go b/botfilter.go index 8318ca7e..2a257261 100644 --- a/botfilter.go +++ b/botfilter.go @@ -138,3 +138,11 @@ func (r *statusRecorder) Flush() { } } +func (r *statusRecorder) Hijack() (net.Conn, *bufio.ReadWriter, error) { + hijacker, ok := r.ResponseWriter.(http.Hijacker) + if !ok { + return nil, nil, http.ErrNotSupported + } + return hijacker.Hijack() +} +