fix(home): use net.JoinHostPort for consistent host:port formatting

This commit is contained in:
Luis Pater
2026-05-16 16:11:38 +08:00
parent 82c9e0de58
commit 7a1a3408bf
+3 -1
View File
@@ -5,8 +5,10 @@ import (
"encoding/json"
"errors"
"fmt"
"net"
"net/http"
"sort"
"strconv"
"strings"
"sync"
"sync/atomic"
@@ -130,7 +132,7 @@ func (c *Client) addrLocked() (string, bool) {
if c.homeCfg.Port <= 0 {
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 {