fix: widen coverage of internal ip space in isInternalIP

This commit is contained in:
henrygd
2026-08-26 12:47:23 -04:00
parent 0ad707288a
commit d7256c7af7
2 changed files with 27 additions and 5 deletions

View File

@@ -203,6 +203,16 @@ func isInternalURL(rawURL string) (bool, error) {
return false, nil
}
func isInternalIP(ip net.IP) bool {
return ip.IsPrivate() || ip.IsLoopback() || ip.IsUnspecified()
var cgnatNetwork = &net.IPNet{
IP: net.IPv4(100, 64, 0, 0),
Mask: net.CIDRMask(10, 32),
}
func isInternalIP(ip net.IP) bool {
return ip.IsPrivate() ||
ip.IsLoopback() ||
ip.IsUnspecified() ||
ip.IsLinkLocalUnicast() ||
ip.IsMulticast() ||
cgnatNetwork.Contains(ip)
}