mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Check error
This commit is contained in:
parent
aaa59df308
commit
6fef2caaa8
1 changed files with 4 additions and 1 deletions
|
@ -693,7 +693,10 @@ func checkIsRelayURLAcceptable(
|
|||
if isHostnameLocal(hostname) {
|
||||
return fmt.Errorf("rejected Relay URL: private hostnames are not allowed")
|
||||
}
|
||||
ipArray, _ := net.LookupIP(hostname)
|
||||
ipArray, err := net.LookupIP(hostname)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Could not look up IP")
|
||||
}
|
||||
for _, ip := range ipArray {
|
||||
if !isRemoteAddress(ip) {
|
||||
return fmt.Errorf("rejected Relay URL: private IPs are not allowed")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue