fix redirect loops on non-standard ports
Alan Pearce alan@alanpearce.eu
Thu, 27 Jun 2024 13:25:26 +0200
1 files changed, 3 insertions(+), 1 deletions(-)
jump to
M internal/server/server.go → internal/server/server.go
@@ -61,13 +61,15 @@ } else { config.Domains = []string{runtimeConfig.ListenAddress} } scheme := "http" + port := runtimeConfig.Port if runtimeConfig.TLS { scheme = "https" + port = runtimeConfig.TLSPort } config.BaseURL = cfg.URL{ URL: &url.URL{ Scheme: scheme, - Host: runtimeConfig.ListenAddress, + Host: net.JoinHostPort(config.Domains[0], strconv.Itoa(port)), }, } }