diff options
author | Francis Lavoie <lavofr@gmail.com> | 2020-09-21 15:44:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-21 13:44:41 -0600 |
commit | fe27f9cf0c7f53c891c35fbcf6a6b3219e85fd0a (patch) | |
tree | 135e72afa0dada087df35c52b515e854dc80c5cd | |
parent | b1d456d8abf15616afb6c6893af90473b4941365 (diff) |
httpcaddyfile: Disallow args on route/handle directive family (#3740)
-rw-r--r-- | caddyconfig/httpcaddyfile/directives.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/caddyconfig/httpcaddyfile/directives.go b/caddyconfig/httpcaddyfile/directives.go index 9e17eeb..e9ba44c 100644 --- a/caddyconfig/httpcaddyfile/directives.go +++ b/caddyconfig/httpcaddyfile/directives.go @@ -285,6 +285,11 @@ func parseSegmentAsConfig(h Helper) ([]ConfigValue, error) { var allResults []ConfigValue for h.Next() { + // don't allow non-matcher args on the first line + if h.NextArg() { + return nil, h.ArgErr() + } + // slice the linear list of tokens into top-level segments var segments []caddyfile.Segment for nesting := h.Nesting(); h.NextBlock(nesting); { |