Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
httpcaddyfile: Fix nil pointer dereference
Matthew Holt committed
Sep 18, 2019 at 10:51 UTC
39d61cad2d27cb7869e7dbf64faad7d90857e944
1 file changed
+2
-2
caddyconfig/httpcaddyfile/httptype.go
+2
-2
@@ -266,9 +266,9 @@ func (st *ServerType) serversFromPairings(
266
if err != nil {
267
return nil, err
268
}
269
- if _, ok := sblock.pile["tls.off"]; ok {
269
+ if _, ok := sblock.pile["tls.off"]; ok && len(autoHTTPSQualifiedHosts) > 0 {
270
// tls off: disable TLS (and automatic HTTPS) for server block's names
271
- if srv.AutoHTTPS == nil && len(autoHTTPSQualifiedHosts) > 0 {
271
+ if srv.AutoHTTPS == nil {
272
srv.AutoHTTPS = new(caddyhttp.AutoHTTPSConfig)
273
}
274
srv.AutoHTTPS.Skip = append(srv.AutoHTTPS.Skip, autoHTTPSQualifiedHosts...)