refactor: simplify CheckIPAccess by reusing IPInAllowList
This commit is contained in:
parent
66f608f25b
commit
6e481c36c5
@ -76,13 +76,7 @@ func CheckIPAccess(ctx *fasthttp.RequestCtx, allowed []net.IPNet) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, network := range allowed {
|
||||
if network.Contains(clientIP) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
return IPInAllowList(clientIP, allowed)
|
||||
}
|
||||
|
||||
// CheckTokenAuth checks token-based authentication.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user