Skip to content

Commit

Permalink
httpcaddyfile: Disallow args on route/handle directive family (#3740)
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie authored Sep 21, 2020
1 parent b1d456d commit fe27f9c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions caddyconfig/httpcaddyfile/directives.go
Original file line number Diff line number Diff line change
Expand Up @@ -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); {
Expand Down

0 comments on commit fe27f9c

Please sign in to comment.