mirror of
https://github.com/adnanh/webhook.git
synced 2026-07-27 01:29:16 +08:00
Use strings.Contains
This commit is contained in:
+1
-1
@@ -196,7 +196,7 @@ func CheckIPWhitelist(remoteAddr string, ipRange string) (bool, error) {
|
||||
|
||||
ipRange = strings.TrimSpace(ipRange)
|
||||
|
||||
if strings.Index(ipRange, "/") == -1 {
|
||||
if !strings.Contains(ipRange, "/") {
|
||||
ipRange = ipRange + "/32"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user