caddyfile: Improve Dispenser.NextBlock() to support nesting

This commit is contained in:
Matthew Holt
2019-09-10 19:21:52 -06:00
parent 0cf592fa2e
commit 2459c292a4
14 changed files with 95 additions and 58 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error)
return nil, h.ArgErr()
}
for h.NextBlock() {
for h.NextBlock(0) {
switch h.Val() {
case "hide":
fsrv.Hide = h.RemainingArgs()
+1 -1
View File
@@ -69,7 +69,7 @@ func (MatchFile) CaddyModule() caddy.ModuleInfo {
//
func (m *MatchFile) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
for d.Next() {
for d.NextBlock() {
for d.NextBlock(0) {
switch d.Val() {
case "root":
if !d.NextArg() {