This commit is contained in:
Max Lerebourg
2022-09-29 10:00:44 +02:00
parent ae959e4e0d
commit dd36df5147
+2 -1
View File
@@ -257,7 +257,8 @@ func contains(source []string, target string) bool {
// Otherwise return with an error to add the IP in cache if we are on. // Otherwise return with an error to add the IP in cache if we are on.
func getDecision(clientIP string) (bool, error) { func getDecision(clientIP string) (bool, error) {
isBanned, ok := cache.Get(clientIP) isBanned, ok := cache.Get(clientIP)
if ok && len(isBanned.(string)) > 0 { banned, err := isBanned.(string)
if ok && err == nil && len(banned) > 0 {
return isBanned == cacheNoBannedValue, nil return isBanned == cacheNoBannedValue, nil
} }
return false, fmt.Errorf("no data") return false, fmt.Errorf("no data")