all repos — homestead @ 1e98d28d121ba76d9a1eade5ad6cd9266cb65591

Code for my website

fix inconsistent handling of IPv6 listen address

Alan Pearce
commit

1e98d28d121ba76d9a1eade5ad6cd9266cb65591

parent

86164f86ec079e15c5fe8e32cb04c71a36e8d94f

1 file changed, 5 insertions(+), 1 deletion(-)

changed files
M cmd/server/main.gocmd/server/main.go
@@ -6,8 +6,8 @@ "fmt"
"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"
@@ -24,6 +24,10 @@ }
panic("parsing runtime configuration" + err.Error()) } 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")