feat(botfilter): add clientCache.observeRequest
This commit is contained in:
1 parent
06a8ccb0d6
commit
7cc5d27322
1 file changed
+7
@@ -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}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user