diff options
Diffstat (limited to 'plugins/http/config/ip.go')
-rw-r--r-- | plugins/http/config/ip.go | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/plugins/http/config/ip.go b/plugins/http/config/ip.go deleted file mode 100644 index c4981f74..00000000 --- a/plugins/http/config/ip.go +++ /dev/null @@ -1,26 +0,0 @@ -package config - -import "net" - -// Cidrs is a slice of IPNet addresses -type Cidrs []*net.IPNet - -// IsTrusted checks if the ip address exists in the provided in the config addresses -func (c *Cidrs) IsTrusted(ip string) bool { - if len(*c) == 0 { - return false - } - - i := net.ParseIP(ip) - if i == nil { - return false - } - - for _, cird := range *c { - if cird.Contains(i) { - return true - } - } - - return false -} |