caddyfile: Refactor; NewFromNextSegment(); fix repeated matchers

Now multiple instances of the same matcher can be used within a named
matcher without overwriting previous ones.
This commit is contained in:
Matthew Holt
2020-02-14 11:00:16 -07:00
parent eb80165583
commit 15bf9c196c
8 changed files with 76 additions and 13 deletions

View File

@ -73,7 +73,7 @@ func (enc *Encode) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
if !ok {
return fmt.Errorf("encoder module '%s' is not a Caddyfile unmarshaler", mod)
}
err = unm.UnmarshalCaddyfile(d.NewFromNextTokens())
err = unm.UnmarshalCaddyfile(d.NewFromNextSegment())
if err != nil {
return err
}