Fix some missing net.JoinHostPort calls (#2305)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2022-07-29 12:08:37 -04:00
1 parent 418129d564
commit 4bd249d347
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -660,7 +660,7 @@ func (c *Client) NewRequest(ctx context.Context, method, requestPath string, bod
return nil, fmt.Errorf("error performing SRV lookup of http:tcp:%s : %w", u.Hostname(), err)
}
if len(addrs) > 0 {
host = fmt.Sprintf("%s:%d", addrs[0].Target, addrs[0].Port)
host = net.JoinHostPort(addrs[0].Target, fmt.Sprintf("%d", addrs[0].Port))
}
}
+1 -1
View File
@@ -74,7 +74,7 @@ func (tw *TestWorker) ProxyAddrs() []string {
if !ok {
tw.t.Fatal("could not parse address as a TCP addr")
}
addr := fmt.Sprintf("%s:%d", tcpAddr.IP.String(), tcpAddr.Port)
addr := net.JoinHostPort(tcpAddr.IP.String(), fmt.Sprintf("%d", tcpAddr.Port))
tw.addrs = append(tw.addrs, addr)
}
}