summaryrefslogtreecommitdiffhomepage
path: root/caddyconfig
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2021-05-11 15:26:07 -0600
committerMatthew Holt <[email protected]>2021-05-11 15:26:07 -0600
commitdbe164d98a58e8b0dbf3fed26e4e9bb6f668a9e2 (patch)
tree16252c8c08a262e824741daf9a837f847646b9fa /caddyconfig
parentbc2210247861340c644d9825ac2b2860f8c6e12a (diff)
downloadcaddy-dbe164d98a58e8b0dbf3fed26e4e9bb6f668a9e2.tar.gz
caddy-dbe164d98a58e8b0dbf3fed26e4e9bb6f668a9e2.zip
httpcaddyfile: Fix automation policy consolidation again (fix #4161)
Also fix a previous test that asserted incorrect behavior.
Diffstat (limited to 'caddyconfig')
-rw-r--r--caddyconfig/httpcaddyfile/tlsapp.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/caddyconfig/httpcaddyfile/tlsapp.go b/caddyconfig/httpcaddyfile/tlsapp.go
index c4af8e4c3..2510a9bf8 100644
--- a/caddyconfig/httpcaddyfile/tlsapp.go
+++ b/caddyconfig/httpcaddyfile/tlsapp.go
@@ -510,7 +510,10 @@ outer:
// if they're exactly equal in every way, just keep one of them
if reflect.DeepEqual(aps[i], aps[j]) {
aps = append(aps[:j], aps[j+1:]...)
- break
+ // must re-evaluate current i against next j; can't skip it!
+ // even if i decrements to -1, will be incremented to 0 immediately
+ i--
+ continue outer
}
// if the policy is the same, we can keep just one, but we have