summaryrefslogtreecommitdiff
path: root/caddyconfig
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-09-18 10:51:49 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-09-18 10:51:49 -0600
commit39d61cad2d27cb7869e7dbf64faad7d90857e944 (patch)
tree36b65da79cbb18ce092da9e5821684838f668ce1 /caddyconfig
parentbc9f9448370d7a5535b33e7407760998b4875e45 (diff)
httpcaddyfile: Fix nil pointer dereference
Diffstat (limited to 'caddyconfig')
-rw-r--r--caddyconfig/httpcaddyfile/httptype.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go
index 4588b8f..6b2ee6b 100644
--- a/caddyconfig/httpcaddyfile/httptype.go
+++ b/caddyconfig/httpcaddyfile/httptype.go
@@ -266,9 +266,9 @@ func (st *ServerType) serversFromPairings(
if err != nil {
return nil, err
}
- if _, ok := sblock.pile["tls.off"]; ok {
+ if _, ok := sblock.pile["tls.off"]; ok && len(autoHTTPSQualifiedHosts) > 0 {
// tls off: disable TLS (and automatic HTTPS) for server block's names
- if srv.AutoHTTPS == nil && len(autoHTTPSQualifiedHosts) > 0 {
+ if srv.AutoHTTPS == nil {
srv.AutoHTTPS = new(caddyhttp.AutoHTTPSConfig)
}
srv.AutoHTTPS.Skip = append(srv.AutoHTTPS.Skip, autoHTTPSQualifiedHosts...)