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" "fmt"
"io" "io"
"log" "log"
mathRand "math/rand"
"net" "net"
"net/http" "net/http"
"net/url" "net/url"
@ -691,6 +692,7 @@ func checkIsRelayURLAcceptable(
if !allowPrivateIPs { if !allowPrivateIPs {
hostname := parsedRelayURL.Hostname() hostname := parsedRelayURL.Hostname()
ipArray, _ := net.LookupIP(hostname) ipArray, _ := net.LookupIP(hostname)
time.Sleep(time.Second * time.Duration(mathRand.Float64()))
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")
} }