feat(botfilter): botfilter.go part 2/2
This commit is contained in:
1 parent
3fcc7cdf36
commit
25dfbde1de
1 file changed
+7
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user