Issue 388 (#389)

* add extra test

* middleware/auto: fix crash when calling empty handler

Don't call the next middleware, we should be auth. for this zone
getitng into this path we should respond with ServFail.

Fixes #388
This commit is contained in:
Miek Gieben
2016-11-07 11:12:20 +00:00
committed by GitHub
parent 0f22d32191
commit 3d5be649a2
3 changed files with 41 additions and 8 deletions

View File

@@ -43,11 +43,9 @@ func (f File) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i
}
return dns.RcodeServerFailure, errors.New("no next middleware found")
}
z, ok := f.Zones.Z[zone]
if !ok {
return f.Next.ServeDNS(ctx, w, r)
}
if z == nil {
if !ok || z == nil {
return dns.RcodeServerFailure, nil
}