aboutsummaryrefslogtreecommitdiffhomepage
path: root/caddyconfig/httpcaddyfile/tlsapp.go
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2020-12-07 14:22:47 -0700
committerMatthew Holt <[email protected]>2020-12-07 14:22:47 -0700
commit7e719157d9b7002fc09de63344f7b4fdfa7e9f57 (patch)
tree7a23f0b93af7cd7b04f100320bdbb67ca693a523 /caddyconfig/httpcaddyfile/tlsapp.go
parent6e9ac248dd5c2f7a4cd4e37ff277a86c18085be6 (diff)
downloadcaddy-7e719157d9b7002fc09de63344f7b4fdfa7e9f57.tar.gz
caddy-7e719157d9b7002fc09de63344f7b4fdfa7e9f57.zip
httpcaddyfile: Decrement counter when removing conn policy (fix #3906)
Diffstat (limited to 'caddyconfig/httpcaddyfile/tlsapp.go')
-rw-r--r--caddyconfig/httpcaddyfile/tlsapp.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/caddyconfig/httpcaddyfile/tlsapp.go b/caddyconfig/httpcaddyfile/tlsapp.go
index fe4c1b15b..6a6e3ca1a 100644
--- a/caddyconfig/httpcaddyfile/tlsapp.go
+++ b/caddyconfig/httpcaddyfile/tlsapp.go
@@ -487,6 +487,7 @@ func consolidateAutomationPolicies(aps []*caddytls.AutomationPolicy) []*caddytls
// remove or combine duplicate policies
for i := 0; i < len(aps); i++ {
+ // compare only with next policies; we sorted by specificity so we must not delete earlier policies
for j := i + 1; j < len(aps); j++ {
// if they're exactly equal in every way, just keep one of them
if reflect.DeepEqual(aps[i], aps[j]) {
@@ -526,6 +527,7 @@ func consolidateAutomationPolicies(aps []*caddytls.AutomationPolicy) []*caddytls
}
}
aps = append(aps[:j], aps[j+1:]...)
+ j--
}
}
}