From 39d61cad2d27cb7869e7dbf64faad7d90857e944 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 18 Sep 2019 10:51:49 -0600 Subject: httpcaddyfile: Fix nil pointer dereference --- caddyconfig/httpcaddyfile/httptype.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'caddyconfig') 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...) -- cgit v1.2.3