aboutsummaryrefslogtreecommitdiff
path: root/middleware/auto
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-11-07 11:12:20 +0000
committerGravatar GitHub <noreply@github.com> 2016-11-07 11:12:20 +0000
commit3d5be649a293d5eb63537b653f574d4227cdd916 (patch)
treeeb8c5d75e97eeffecc80c91206c7943638eb973f /middleware/auto
parent0f22d321914140839dcd27c51b4d02a963eba0da (diff)
downloadcoredns-3d5be649a293d5eb63537b653f574d4227cdd916.tar.gz
coredns-3d5be649a293d5eb63537b653f574d4227cdd916.tar.zst
coredns-3d5be649a293d5eb63537b653f574d4227cdd916.zip
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
Diffstat (limited to 'middleware/auto')
-rw-r--r--middleware/auto/auto.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/middleware/auto/auto.go b/middleware/auto/auto.go
index 11d138a7a..eaff7fd18 100644
--- a/middleware/auto/auto.go
+++ b/middleware/auto/auto.go
@@ -64,10 +64,7 @@ func (a Auto) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i
z, ok := a.Zones.Z[zone]
a.Zones.RUnlock()
- if !ok {
- return a.Next.ServeDNS(ctx, w, r)
- }
- if z == nil {
+ if !ok || z == nil {
return dns.RcodeServerFailure, nil
}