summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--caddyconfig/httpcaddyfile/tlsapp.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/caddyconfig/httpcaddyfile/tlsapp.go b/caddyconfig/httpcaddyfile/tlsapp.go
index aa3e5be..db6bf98 100644
--- a/caddyconfig/httpcaddyfile/tlsapp.go
+++ b/caddyconfig/httpcaddyfile/tlsapp.go
@@ -444,7 +444,12 @@ func consolidateAutomationPolicies(aps []*caddytls.AutomationPolicy) []*caddytls
} else if len(aps[i].Subjects) > 0 && len(aps[j].Subjects) == 0 {
aps = append(aps[:i], aps[i+1:]...)
} else {
- aps[i].Subjects = append(aps[i].Subjects, aps[j].Subjects...)
+ // avoid repeated subjects
+ for _, subj := range aps[j].Subjects {
+ if !sliceContains(aps[i].Subjects, subj) {
+ aps[i].Subjects = append(aps[i].Subjects, subj)
+ }
+ }
aps = append(aps[:j], aps[j+1:]...)
}
i--