Browse Source
caddytls: Ensure automation field is not nil when appending (fix #2779)
master
Matthew Holt
6 years ago
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5
1 changed files with
3 additions and
0 deletions
-
caddyconfig/httpcaddyfile/httptype.go
|
|
@ -182,6 +182,9 @@ func (st ServerType) Setup(originalServerBlocks []caddyfile.ServerBlock, |
|
|
|
return nil, warnings, err |
|
|
|
} |
|
|
|
if len(sblockHosts) > 0 { |
|
|
|
if tlsApp.Automation == nil { |
|
|
|
tlsApp.Automation = new(caddytls.AutomationConfig) |
|
|
|
} |
|
|
|
tlsApp.Automation.Policies = append(tlsApp.Automation.Policies, caddytls.AutomationPolicy{ |
|
|
|
Hosts: sblockHosts, |
|
|
|
ManagementRaw: caddyconfig.JSONModuleObject(mm, "module", mm.(caddy.Module).CaddyModule().ID(), &warnings), |
|
|
|