Fix some missing net.JoinHostPort calls (#2305)
This commit is contained in:
1 parent
418129d564
commit
4bd249d347
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user