diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-10-06 20:46:10 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-10-06 20:46:10 -0600 |
commit | 8c55167f71eefc9ee693e0d83750126f7700cb6e (patch) | |
tree | 4888679d56d8abdd6c495b946494bc1890b7b12f /modules/caddyhttp | |
parent | be7abda7d498272e360fe6fae18984c309533de3 (diff) |
rewrite: Return parse error if too many Caddyfile args (fixes #2791)
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r-- | modules/caddyhttp/rewrite/caddyfile.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/caddyhttp/rewrite/caddyfile.go b/modules/caddyhttp/rewrite/caddyfile.go index f33c5c8..cb65d43 100644 --- a/modules/caddyhttp/rewrite/caddyfile.go +++ b/modules/caddyhttp/rewrite/caddyfile.go @@ -32,6 +32,9 @@ func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) var rewr Rewrite for h.Next() { rewr.URI = h.Val() + if h.NextArg() { + return nil, h.ArgErr() + } } rewr.Rehandle = true return rewr, nil |