From 6e6ce2be6be004f592978d9f020f0185b40af1a7 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Tue, 18 Jan 2022 13:56:00 -0500 Subject: caddyhttp: Fix HTTP->HTTPS redir not preferring HTTPS port if ambiguous (#4530) --- modules/caddyhttp/autohttps.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/caddyhttp') diff --git a/modules/caddyhttp/autohttps.go b/modules/caddyhttp/autohttps.go index da4428d..6c37d70 100644 --- a/modules/caddyhttp/autohttps.go +++ b/modules/caddyhttp/autohttps.go @@ -232,7 +232,7 @@ func (app *App) automaticHTTPSPhase1(ctx caddy.Context, repl *caddy.Replacer) er // port, we'll have to choose one, so prefer the HTTPS port if _, ok := redirDomains[d]; !ok || addr.StartPort == uint(app.httpsPort()) { - redirDomains[d] = append(redirDomains[d], addr) + redirDomains[d] = []caddy.NetworkAddress{addr} } } } -- cgit v1.2.3