Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
httpcaddyfile: Disallow args on route/handle directive family (#3740)
Francis Lavoie committed
Sep 21, 2020 at 15:44 UTC
fe27f9cf0c7f53c891c35fbcf6a6b3219e85fd0a
1 file changed
+5
caddyconfig/httpcaddyfile/directives.go
+5
@@ -285,6 +285,11 @@ func parseSegmentAsConfig(h Helper) ([]ConfigValue, error) {
285
var allResults []ConfigValue
286
287
for h.Next() {
288
+ // don't allow non-matcher args on the first line
289
+ if h.NextArg() {
290
+ return nil, h.ArgErr()
291
+ }
292
+
293
// slice the linear list of tokens into top-level segments
294
var segments []caddyfile.Segment
295
for nesting := h.Nesting(); h.NextBlock(nesting); {