From 7a1a3408bfa60ee85a9b0b435b7b9296b29c7129 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Sat, 16 May 2026 16:11:38 +0800 Subject: [PATCH] fix(home): use net.JoinHostPort for consistent host:port formatting --- internal/home/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/home/client.go b/internal/home/client.go index 40a191fe..9e7a9056 100644 --- a/internal/home/client.go +++ b/internal/home/client.go @@ -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 {