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

View File

@@ -57,7 +57,7 @@ func (s *StaticResponse) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
if d.Args(&statusCodeStr) {
s.StatusCode = WeakString(statusCodeStr)
}
for d.NextBlock() {
for d.NextBlock(0) {
switch d.Val() {
case "body":
if s.Body != "" {