From 25dfbde1de10ad09ac92e9dcdda00d283ab62de7 Mon Sep 17 00:00:00 2001 From: hoelee Date: Thu, 14 May 2026 13:26:00 +0800 Subject: [PATCH] feat(botfilter): botfilter.go part 2/2 --- botfilter.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/botfilter.go b/botfilter.go index c7197c91..e941451a 100644 --- a/botfilter.go +++ b/botfilter.go @@ -69,3 +69,10 @@ func (b *botFilter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { return } + recorder := &statusRecorder{ResponseWriter: rw} + b.next.ServeHTTP(recorder, r) + if result := b.cache.observeResponse(ip, recorder.statusCode(), b.config.NotFoundScore, time.Now()); result.banned { + b.logger.blocked(ip, "404 score threshold", result.score) + } +} +