From 263ffbfaecc5ed8b7f5071baecf51b4e9d90e7bf Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 4 Nov 2019 13:25:37 -0700 Subject: caddyfile: Fix bug with Delete It now will delete the current token even if it is the last one --- caddyconfig/httpcaddyfile/directives.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'caddyconfig/httpcaddyfile/directives.go') diff --git a/caddyconfig/httpcaddyfile/directives.go b/caddyconfig/httpcaddyfile/directives.go index f1ce0f1..e56d101 100644 --- a/caddyconfig/httpcaddyfile/directives.go +++ b/caddyconfig/httpcaddyfile/directives.go @@ -64,7 +64,8 @@ func RegisterHandlerDirective(dir string, setupFunc UnmarshalHandlerFunc) { return nil, err } if ok { - h.Dispenser.Delete() // strip matcher token + tokens := h.Dispenser.Delete() // strip matcher token + h.Dispenser = caddyfile.NewDispenser(tokens) } h.Dispenser.Reset() // pretend this lookahead never happened -- cgit v1.2.3