split host port

This commit is contained in:
Zack Scholl 2020-10-05 08:19:09 -07:00
parent e145f6c61a
commit b73c0cba22
1 changed files with 3 additions and 0 deletions

View File

@ -278,6 +278,9 @@ var PrivateIPNetworks = []net.IPNet{
}
func IsLocalIP(ipaddress string) bool {
if strings.Contains("localhost") {
return true
}
host, _, _ := net.SplitHostPort(ipaddress)
ip := net.ParseIP(host)
for _, ipNet := range PrivateIPNetworks {