From 2459c292a4d6fb0552eb9be3cecd955093ed853b Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Tue, 10 Sep 2019 19:21:52 -0600 Subject: caddyfile: Improve Dispenser.NextBlock() to support nesting --- modules/caddyhttp/matchers.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/caddyhttp/matchers.go') diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go index 4d0eea5..23047d0 100644 --- a/modules/caddyhttp/matchers.go +++ b/modules/caddyhttp/matchers.go @@ -258,6 +258,9 @@ func (MatchHeader) CaddyModule() caddy.ModuleInfo { // UnmarshalCaddyfile implements caddyfile.Unmarshaler. func (m *MatchHeader) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { + if *m == nil { + *m = make(map[string][]string) + } for d.Next() { var field, val string if !d.Args(&field, &val) { -- cgit v1.2.3