Skip to content

Commit

Permalink
Small update on customRateLimit check
Browse files Browse the repository at this point in the history
  • Loading branch information
radu-todirica committed Feb 15, 2024
1 parent a2b019f commit add1bfb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit add1bfb

Please sign in to comment.