@marcel91200 / caddy Mirror · read-only / commits / c95db355
Fork 0

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

caddytls: Ensure automation field is not nil when appending (fix #2779)

Matthew Holt committed Sep 30, 2019 at 11:53 UTC c95db3551d79112513196b71841de8d010a42b25
1 file changed +3
caddyconfig/httpcaddyfile/httptype.go
+3
@@ -182,6 +182,9 @@ func (st ServerType) Setup(originalServerBlocks []caddyfile.ServerBlock,
182 return nil, warnings, err
183 }
184 if len(sblockHosts) > 0 {
185 + if tlsApp.Automation == nil {
186 + tlsApp.Automation = new(caddytls.AutomationConfig)
187 + }
188 tlsApp.Automation.Policies = append(tlsApp.Automation.Policies, caddytls.AutomationPolicy{
189 Hosts: sblockHosts,
190 ManagementRaw: caddyconfig.JSONModuleObject(mm, "module", mm.(caddy.Module).CaddyModule().ID(), &warnings),