Add delay

This commit is contained in:
Neel Chauhan 2024-10-14 09:54:05 -04:00
parent 37a2570643
commit e983f7425c

View file

@ -32,6 +32,7 @@ import (
"fmt"
"io"
"log"
mathRand "math/rand"
"net"
"net/http"
"net/url"
@ -691,6 +692,7 @@ func checkIsRelayURLAcceptable(
if !allowPrivateIPs {
hostname := parsedRelayURL.Hostname()
ipArray, _ := net.LookupIP(hostname)
time.Sleep(time.Second * time.Duration(mathRand.Float64()))
if isHostnameLocal(hostname) {
return fmt.Errorf("rejected Relay URL: private hostnames are not allowed")
}