summaryrefslogtreecommitdiff
path: root/caddyconfig
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2022-09-20 10:09:04 -0400
committerGitHub <noreply@github.com>2022-09-20 08:09:04 -0600
commit821a08a6e39ed0e7c43b0271ccf126c194eb6339 (patch)
tree3900e490a87626c50c3710e386cec8001aaf0813 /caddyconfig
parente3d04ff86b5bf886bc4c6cf7806987eeda96d163 (diff)
httpcaddyfile: Fix `protocols` global option parsing (#5054)
* httpcaddyfile: Fix `protocols` global option parsing When checking for a block, the current nesting must be used, otherwise it returns the wrong thing. * Adjust adapt test to cover the broken behaviour that is now fixed * Fix some admin tests which suddenly run even with -short
Diffstat (limited to 'caddyconfig')
-rw-r--r--caddyconfig/httpcaddyfile/serveroptions.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/caddyconfig/httpcaddyfile/serveroptions.go b/caddyconfig/httpcaddyfile/serveroptions.go
index 8e021fd..8ab8969 100644
--- a/caddyconfig/httpcaddyfile/serveroptions.go
+++ b/caddyconfig/httpcaddyfile/serveroptions.go
@@ -162,7 +162,7 @@ func unmarshalCaddyfileServerOptions(d *caddyfile.Dispenser) (any, error) {
}
serverOpts.Protocols = append(serverOpts.Protocols, proto)
}
- if d.NextBlock(0) {
+ if nesting := d.Nesting(); d.NextBlock(nesting) {
return nil, d.ArgErr()
}