mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Reduce network load
This commit is contained in:
parent
5e4619bae1
commit
aaa59df308
1 changed files with 1 additions and 1 deletions
|
@ -690,10 +690,10 @@ func checkIsRelayURLAcceptable(
|
||||||
}
|
}
|
||||||
if !allowPrivateIPs {
|
if !allowPrivateIPs {
|
||||||
hostname := parsedRelayURL.Hostname()
|
hostname := parsedRelayURL.Hostname()
|
||||||
ipArray, _ := net.LookupIP(hostname)
|
|
||||||
if isHostnameLocal(hostname) {
|
if isHostnameLocal(hostname) {
|
||||||
return fmt.Errorf("rejected Relay URL: private hostnames are not allowed")
|
return fmt.Errorf("rejected Relay URL: private hostnames are not allowed")
|
||||||
}
|
}
|
||||||
|
ipArray, _ := net.LookupIP(hostname)
|
||||||
for _, ip := range ipArray {
|
for _, ip := range ipArray {
|
||||||
if !isRemoteAddress(ip) {
|
if !isRemoteAddress(ip) {
|
||||||
return fmt.Errorf("rejected Relay URL: private IPs are not allowed")
|
return fmt.Errorf("rejected Relay URL: private IPs are not allowed")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue