middleware/file: transfer from does not make sense (#314)

Make it return an error when you use `transfer from` when you're
not a secondary.

Add tests as well.

Fixes #310
This commit is contained in:
Miek Gieben 2016-10-02 19:41:00 +01:00 committed by GitHub
parent 560f11d148
commit cc486fb900
3 changed files with 15 additions and 4 deletions

View file

@ -63,7 +63,7 @@ func secondaryParse(c *caddy.Controller) (file.Zones, error) {
}
for c.NextBlock() {
t, f, e := file.TransferParse(c)
t, f, e := file.TransferParse(c, true)
if e != nil {
return file.Zones{}, e
}