Enhance testing

This commit is contained in:
Neel Chauhan 2024-10-17 20:02:39 -04:00
parent e22f397d84
commit 2d128985ba
2 changed files with 9 additions and 6 deletions

View file

@ -682,7 +682,10 @@ func checkIsRelayURLAcceptable(
return fmt.Errorf("rejected Relay URL: private IPs are not allowed")
}
} else {
ipArray, _ := net.LookupIP(hostname)
ipArray, err := net.LookupIP(hostname)
if err != nil {
return fmt.Errorf("Could not look up IP %s", hostname)
}
for _, ip := range ipArray {
if !isRemoteAddress(ip) {
return fmt.Errorf("rejected Relay URL: private IPs are not allowed")