fix(home): use net.JoinHostPort for consistent host:port formatting
This commit is contained in:
@@ -5,8 +5,10 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
@@ -130,7 +132,7 @@ func (c *Client) addrLocked() (string, bool) {
|
|||||||
if c.homeCfg.Port <= 0 {
|
if c.homeCfg.Port <= 0 {
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%s:%d", host, c.homeCfg.Port), true
|
return net.JoinHostPort(host, strconv.Itoa(c.homeCfg.Port)), true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ensureClients() error {
|
func (c *Client) ensureClients() error {
|
||||||
|
|||||||
Reference in New Issue
Block a user