From b22ceb6c830f07061e5e16e1428438b495efe9d6 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 2 Jul 2024 11:47:36 +0200 Subject: fix inconsistent handling of IPv6 listen address --- cmd/server/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cmd/server') diff --git a/cmd/server/main.go b/cmd/server/main.go index ca69ba2..be36e3b 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -6,8 +6,8 @@ import ( "os" "os/signal" - "go.alanpearce.eu/x/log" "go.alanpearce.eu/website/internal/server" + "go.alanpearce.eu/x/log" "github.com/ardanlabs/conf/v3" "gitlab.com/tozd/go/errors" @@ -25,6 +25,10 @@ func main() { } log := log.Configure(!runtimeConfig.Development) + if listenAddress := runtimeConfig.ListenAddress; listenAddress[0] == '[' { + runtimeConfig.ListenAddress = listenAddress[1 : len(listenAddress)-1] + } + if runtimeConfig.Development { tmpdir, err := os.MkdirTemp("", "website") if err != nil { -- cgit 1.4.1