diff options
author | Francis Lavoie <lavofr@gmail.com> | 2021-03-29 12:55:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 10:55:29 -0600 |
commit | f1c36680fc8b21d5f8c110d8d3b97c4efe324376 (patch) | |
tree | a74ce558a39eeb4f538f65a7d4d34887865b3c57 /modules | |
parent | a87f757fccabfbaa7c8f80b1acd5faaf8d7d6297 (diff) |
headers: Fix Caddyfile parsing for `request_header` with matchers (#4085)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/caddyhttp/headers/caddyfile.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/caddyhttp/headers/caddyfile.go b/modules/caddyhttp/headers/caddyfile.go index 574e54b..c6ea2fb 100644 --- a/modules/caddyhttp/headers/caddyfile.go +++ b/modules/caddyhttp/headers/caddyfile.go @@ -151,6 +151,10 @@ func parseCaddyfile(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error) // request_header [<matcher>] [[+|-]<field> [<value|regexp>] [<replacement>]] // func parseReqHdrCaddyfile(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error) { + if !h.Next() { + return nil, h.ArgErr() + } + matcherSet, err := h.ExtractMatcherSet() if err != nil { return nil, err |