summaryrefslogtreecommitdiff
path: root/modules/caddyhttp
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2020-11-30 12:20:30 -0500
committerGitHub <noreply@github.com>2020-11-30 10:20:30 -0700
commita26f70a12b1289231d705bc002fe1df3180cb6c5 (patch)
tree7e800807bd1d03f80126900bd528b746e5369195 /modules/caddyhttp
parent4afcdc49d14855c0c3a4fd4558d0f81906db3ffb (diff)
headers: Fix Caddyfile parsing with request matcher (#3892)
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r--modules/caddyhttp/headers/caddyfile.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/caddyhttp/headers/caddyfile.go b/modules/caddyhttp/headers/caddyfile.go
index 75498b2..574e54b 100644
--- a/modules/caddyhttp/headers/caddyfile.go
+++ b/modules/caddyhttp/headers/caddyfile.go
@@ -46,6 +46,10 @@ func init() {
// and ? conditionally sets a value only if the header field is not already
// set.
func parseCaddyfile(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error) {
+ if !h.Next() {
+ return nil, h.ArgErr()
+ }
+
matcherSet, err := h.ExtractMatcherSet()
if err != nil {
return nil, err