Merge pull request #8627 from dokku/8619-certs-add-rewrites-explicit-https-443-port-mappings

Preserve explicit https:443 port mappings on cert update
This commit is contained in:
Jose Diaz-Gonzalez
2026-05-12 21:29:47 -04:00
committed by GitHub
3 changed files with 42 additions and 11 deletions

View File

@@ -176,6 +176,12 @@ func TriggerPostCertsUpdate(appName string) error {
common.PropertyDelete("proxy", appName, "proxy-ssl-port")
}
for _, portMap := range portMaps {
if portMap.Scheme == "https" && portMap.HostPort == 443 {
return nil
}
}
var http80Ports []PortMap
for _, portMap := range portMaps {
if portMap.Scheme == "http" && portMap.HostPort == 80 {
@@ -186,17 +192,6 @@ func TriggerPostCertsUpdate(appName string) error {
http80Ports = uniquePortMaps(http80Ports)
if len(http80Ports) > 0 {
var https443Ports []PortMap
for _, portMap := range portMaps {
if portMap.Scheme == "https" && portMap.HostPort == 443 {
https443Ports = append(https443Ports, portMap)
}
}
if err := removePortMaps(appName, https443Ports); err != nil {
return err
}
var toAdd []PortMap
for _, portMap := range http80Ports {
toAdd = append(toAdd, PortMap{