summaryrefslogtreecommitdiff
path: root/caddyconfig
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2020-09-21 15:44:41 -0400
committerGitHub <noreply@github.com>2020-09-21 13:44:41 -0600
commitfe27f9cf0c7f53c891c35fbcf6a6b3219e85fd0a (patch)
tree135e72afa0dada087df35c52b515e854dc80c5cd /caddyconfig
parentb1d456d8abf15616afb6c6893af90473b4941365 (diff)
httpcaddyfile: Disallow args on route/handle directive family (#3740)
Diffstat (limited to 'caddyconfig')
-rw-r--r--caddyconfig/httpcaddyfile/directives.go5
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); {