Skip to content

Commit

Permalink
Rebase fix
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed Sep 27, 2024
1 parent ad266d8 commit e3e27e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion caddyconfig/httpcaddyfile/httptype.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ func (st *ServerType) serversFromPairings(
if idx := strings.Index(baseDomain, "."); idx != -1 {
baseDomain = baseDomain[idx+1:]
}
if !strings.HasPrefix(addr.Host, "*.") && sliceContains(wildcardHosts, baseDomain) {
if !strings.HasPrefix(addr.Host, "*.") && slices.Contains(wildcardHosts, baseDomain) {
srv.AutoHTTPS.Skip = append(srv.AutoHTTPS.Skip, addr.Host)
}
}
Expand Down
10 changes: 5 additions & 5 deletions caddyconfig/httpcaddyfile/tlsapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (st ServerType) buildTLSApp(
// key, so that they don't get forgotten/omitted by auto-HTTPS
// (since they won't appear in route matchers)
httpsHostsSharedWithHostlessKey := make(map[string]struct{})
if !sliceContains(autoHTTPS, "off") {
if !slices.Contains(autoHTTPS, "off") {
for _, pair := range pairings {
for _, sb := range pair.serverBlocks {
for _, addr := range sb.keys {
Expand Down Expand Up @@ -347,7 +347,7 @@ func (st ServerType) buildTLSApp(
internalAP := &caddytls.AutomationPolicy{
IssuersRaw: []json.RawMessage{json.RawMessage(`{"module":"internal"}`)},
}
if !sliceContains(autoHTTPS, "off") && !sliceContains(autoHTTPS, "disable_certs") {
if !slices.Contains(autoHTTPS, "off") && !slices.Contains(autoHTTPS, "disable_certs") {
for h := range httpsHostsSharedWithHostlessKey {
al = append(al, h)
if !certmagic.SubjectQualifiesForPublicCert(h) {
Expand Down Expand Up @@ -416,7 +416,7 @@ func (st ServerType) buildTLSApp(
// consolidate automation policies that are the exact same
tlsApp.Automation.Policies = consolidateAutomationPolicies(
tlsApp.Automation.Policies,
sliceContains(autoHTTPS, "prefer_wildcard"),
slices.Contains(autoHTTPS, "prefer_wildcard"),
)

// ensure automation policies don't overlap subjects (this should be
Expand Down Expand Up @@ -658,7 +658,7 @@ outer:
continue
}
if certmagic.MatchWildcard(aps[i].SubjectsRaw[iSubj], aps[j].SubjectsRaw[jSubj]) {
iSubjs = append(iSubjs[:iSubj], iSubjs[iSubj+1:]...)
iSubjs = slices.Delete(iSubjs, iSubj, iSubj+1)
iSubj--
break
}
Expand All @@ -668,7 +668,7 @@ outer:

// remove i if it has no subjects left
if len(aps[i].SubjectsRaw) == 0 {
aps = append(aps[:i], aps[i+1:]...)
aps = slices.Delete(aps, i, i+1)
i--
continue outer
}
Expand Down

0 comments on commit e3e27e4

Please sign in to comment.