Skip to content

Commit

Permalink
Rebase fix
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed Oct 1, 2024
1 parent 8b5ed27 commit bdca47d
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 @@ -806,7 +806,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.parsedKeys {
Expand Down Expand Up @@ -351,7 +351,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 @@ -420,7 +420,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 @@ -662,7 +662,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 @@ -672,7 +672,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 bdca47d

Please sign in to comment.