From d46ba2e27fca841c289629fcc5ecf86b7f47d1f9 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Thu, 6 Oct 2022 21:40:08 -0400 Subject: [PATCH] httpcaddyfile: Fix `metrics` global option parsing (#5126) --- caddyconfig/httpcaddyfile/serveroptions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caddyconfig/httpcaddyfile/serveroptions.go b/caddyconfig/httpcaddyfile/serveroptions.go index 8ab8969d..3e206c87 100644 --- a/caddyconfig/httpcaddyfile/serveroptions.go +++ b/caddyconfig/httpcaddyfile/serveroptions.go @@ -180,7 +180,7 @@ func unmarshalCaddyfileServerOptions(d *caddyfile.Dispenser) (any, error) { if d.NextArg() { return nil, d.ArgErr() } - if d.NextBlock(0) { + if nesting := d.Nesting(); d.NextBlock(nesting) { return nil, d.ArgErr() } serverOpts.Metrics = new(caddyhttp.Metrics)