Browse Source
httpcaddyfile: Disallow args on route/handle directive family (#3740)
master
Francis Lavoie
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
0 deletions
-
caddyconfig/httpcaddyfile/directives.go
|
@ -285,6 +285,11 @@ func parseSegmentAsConfig(h Helper) ([]ConfigValue, error) { |
|
|
var allResults []ConfigValue |
|
|
var allResults []ConfigValue |
|
|
|
|
|
|
|
|
for h.Next() { |
|
|
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
|
|
|
// slice the linear list of tokens into top-level segments
|
|
|
var segments []caddyfile.Segment |
|
|
var segments []caddyfile.Segment |
|
|
for nesting := h.Nesting(); h.NextBlock(nesting); { |
|
|
for nesting := h.Nesting(); h.NextBlock(nesting); { |
|
|