diff --git a/cmd/strelaypoolsrv/main.go b/cmd/strelaypoolsrv/main.go index fdaf73de..23ddf4d9 100644 --- a/cmd/strelaypoolsrv/main.go +++ b/cmd/strelaypoolsrv/main.go @@ -326,8 +326,9 @@ func handlePostRequest(w http.ResponseWriter, r *http.Request) { return } + ip := net.ParseIP(host) // The client did not provide an IP address, use the IP address of the client. - if host == "" { + if ip == nil || ip.IsUnspecified() { uri.Host = net.JoinHostPort(rhost, port) newRelay.URL = uri.String() } else if host != rhost {