mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-07-09 16:00:59 +00:00
parent
1ba7bb06a0
commit
314429b879
6 changed files with 176 additions and 14 deletions
|
|
@ -127,7 +127,7 @@ func IsLocalNetworkHost(host string) bool {
|
|||
}
|
||||
|
||||
if ip := net.ParseIP(normalized); ip != nil {
|
||||
return ip.IsPrivate() || ip.IsLinkLocalUnicast()
|
||||
return ip.IsPrivate() || ip.IsLinkLocalUnicast() || isCarrierGradeNATIPv4(ip)
|
||||
}
|
||||
|
||||
if !strings.Contains(normalized, ".") {
|
||||
|
|
@ -143,6 +143,15 @@ func IsLocalNetworkHost(host string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func isCarrierGradeNATIPv4(ip net.IP) bool {
|
||||
v4 := ip.To4()
|
||||
if v4 == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return v4[0] == 100 && v4[1] >= 64 && v4[1] <= 127
|
||||
}
|
||||
|
||||
// PulseURLValidationOptions controls optional relaxations for Pulse runtime
|
||||
// transports. The default zero value preserves the strict production contract.
|
||||
type PulseURLValidationOptions struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue