caddyhttp: Don't append port 0 (fix #7450)

This commit is contained in:
Matthew Holt
2026-02-03 13:29:07 -07:00
parent 3bb22672f9
commit 780640d1e7

View File

@@ -497,7 +497,8 @@ func (app *App) makeRedirRoute(redirToPort uint, matcherSet MatcherSet) Route {
if redirToPort != uint(app.httpPort()) &&
redirToPort != uint(app.httpsPort()) &&
redirToPort != DefaultHTTPPort &&
redirToPort != DefaultHTTPSPort {
redirToPort != DefaultHTTPSPort &&
redirToPort > 0 {
redirTo += ":" + strconv.Itoa(int(redirToPort))
}