mirror of
https://github.com/caddyserver/caddy.git
synced 2025-02-02 06:07:21 +01:00
httpcaddyfile: Fix nil pointer dereference
This commit is contained in:
parent
bc9f944837
commit
39d61cad2d
1 changed files with 2 additions and 2 deletions
|
@ -266,9 +266,9 @@ func (st *ServerType) serversFromPairings(
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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
|
// 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 = new(caddyhttp.AutoHTTPSConfig)
|
||||||
}
|
}
|
||||||
srv.AutoHTTPS.Skip = append(srv.AutoHTTPS.Skip, autoHTTPSQualifiedHosts...)
|
srv.AutoHTTPS.Skip = append(srv.AutoHTTPS.Skip, autoHTTPSQualifiedHosts...)
|
||||||
|
|
Loading…
Reference in a new issue