feat(botfilter): add clientCache.observeRequest

This commit is contained in:
hoelee committed 2026-02-11 11:29:00 +08:00
1 parent d406d7183b
commit 12126232ce
1 file changed
+7
+7
View File
@@ -75,3 +75,10 @@ func (c *clientCache) isBanned(ip string, now time.Time) cacheResult {
return cacheResult{banned: true, banUntil: state.banUntil}
}
func (c *clientCache) observeRequest(ip string, observation requestObservation) cacheResult {
if ip == "" {
// An invalid peer address must never share a cache entry with another
// malformed request. The request can still be rejected by its headers.
return cacheResult{banned: observation.forceBan}
}