From add1bfb93aa7a92f3319656d18aa5c67a670612e Mon Sep 17 00:00:00 2001 From: rtodirica Date: Thu, 15 Feb 2024 16:37:17 +0200 Subject: [PATCH] Small update on customRateLimit check --- common/common.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/common.go b/common/common.go index 0517a99..fcaa4da 100644 --- a/common/common.go +++ b/common/common.go @@ -146,12 +146,11 @@ func HasCustomRateLimit(ip string) (bool, int) { if strings.HasSuffix(customRate.DeviceIp, "/24") { _, ipv4Net, err := net.ParseCIDR(customRate.DeviceIp) if err != nil { - return false, 0 + fmt.Println("Failed cidr parsing from rateLimits file: %s", err) + continue } if ipv4Net.Contains(net.ParseIP(ip)) { return true, customRate.RateLimit - } else { - return false, 0 } } if customRate.DeviceIp == ip {