瀏覽代碼

skip-check: authors

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3650
Xav 9 年之前
父節點
當前提交
96e8f94833
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      cmd/strelaypoolsrv/main.go

+ 2 - 1
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 {