httpcaddyfile: Fix `metrics` global option parsing (#5126)

This commit is contained in:
Francis Lavoie 2022-10-06 21:40:08 -04:00 committed by GitHub
parent 498f32bab9
commit d46ba2e27f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -180,7 +180,7 @@ func unmarshalCaddyfileServerOptions(d *caddyfile.Dispenser) (any, error) {
if d.NextArg() { if d.NextArg() {
return nil, d.ArgErr() return nil, d.ArgErr()
} }
if d.NextBlock(0) { if nesting := d.Nesting(); d.NextBlock(nesting) {
return nil, d.ArgErr() return nil, d.ArgErr()
} }
serverOpts.Metrics = new(caddyhttp.Metrics) serverOpts.Metrics = new(caddyhttp.Metrics)