1
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-16 21:56:40 -05:00

httpcaddyfile: Fix nil pointer dereference

This commit is contained in:
Matthew Holt 2019-09-18 10:51:49 -06:00
parent bc9f944837
commit 39d61cad2d
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -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...)