From 96e8f94833fc3a023b998685b106fcb241f65101 Mon Sep 17 00:00:00 2001 From: Xav Date: Wed, 5 Oct 2016 19:13:47 +0000 Subject: [PATCH] skip-check: authors GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3650 --- cmd/strelaypoolsrv/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/strelaypoolsrv/main.go b/cmd/strelaypoolsrv/main.go index fdaf73def..23ddf4d99 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 {