caddyhttp: Fix HTTP->HTTPS redir not preferring HTTPS port if ambiguous (#4530)

This commit is contained in:
Francis Lavoie 2022-01-18 13:56:00 -05:00 committed by GitHub
parent 1b7ff5d76c
commit 6e6ce2be6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}
}
}
}