From bdca47d9c2ad523fdf17cd9915eaf044b45228ab Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Wed, 25 Sep 2024 20:07:35 -0400 Subject: [PATCH] Rebase fix --- caddyconfig/httpcaddyfile/httptype.go | 2 +- caddyconfig/httpcaddyfile/tlsapp.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go index de2d1ab0569..4dacd9058d0 100644 --- a/caddyconfig/httpcaddyfile/httptype.go +++ b/caddyconfig/httpcaddyfile/httptype.go @@ -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) } } diff --git a/caddyconfig/httpcaddyfile/tlsapp.go b/caddyconfig/httpcaddyfile/tlsapp.go index c2bbc95a483..ed708524d68 100644 --- a/caddyconfig/httpcaddyfile/tlsapp.go +++ b/caddyconfig/httpcaddyfile/tlsapp.go @@ -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 { @@ -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) { @@ -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 @@ -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 } @@ -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 }