From 067ec1dd87d720b733cf8f0ed96ce945775549c9 Mon Sep 17 00:00:00 2001 From: hainenber Date: Sun, 10 Sep 2023 00:42:25 +0700 Subject: [PATCH] fix(caddyfile): reame var to be more intuitive --- caddyconfig/httpcaddyfile/httptype.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go index c543c1ee3d8..79442c8f770 100644 --- a/caddyconfig/httpcaddyfile/httptype.go +++ b/caddyconfig/httpcaddyfile/httptype.go @@ -723,13 +723,13 @@ func (st *ServerType) serversFromPairings( // ensuring compatibility with behavior described in below link // https://caddy.community/t/making-sense-of-auto-https-and-why-disabling-it-still-serves-https-instead-of-http/9761 createdTLSConnPolicies, ok := sblock.pile["tls.connection_policy"] - hasTLSDirectiveSpecified := (ok && len(createdTLSConnPolicies) > 0) || + hasTLSEnabled := (ok && len(createdTLSConnPolicies) > 0) || (addr.Host != "" && srv.AutoHTTPS != nil && !sliceContains(srv.AutoHTTPS.Skip, addr.Host)) // we'll need to remember if the address qualifies for auto-HTTPS, so we // can add a TLS conn policy if necessary if addr.Scheme == "https" || - (addr.Scheme != "http" && addr.Port != httpPort && hasTLSDirectiveSpecified) { + (addr.Scheme != "http" && addr.Port != httpPort && hasTLSEnabled) { addressQualifiesForTLS = true } // predict whether auto-HTTPS will add the conn policy for us; if so, we