mirror of https://github.com/status-im/consul.git
No NXDOMAIN when the answer is empty
This commit is contained in:
parent
80d26f9156
commit
2701bb5cc2
|
@ -532,7 +532,6 @@ RPC:
|
|||
// If the answer is empty, return not found
|
||||
if len(resp.Answer) == 0 {
|
||||
d.addSOA(d.domain, resp)
|
||||
resp.SetRcode(req, dns.RcodeNameError)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2062,6 +2062,10 @@ func TestDNS_NonExistingLookupEmptyAorAAAA(t *testing.T) {
|
|||
t.Fatalf("Bad: %#v", in.Ns[0])
|
||||
}
|
||||
|
||||
if in.Rcode != dns.RcodeSuccess {
|
||||
t.Fatalf("Bad: %#v", in)
|
||||
}
|
||||
|
||||
// check for ipv4 records on ipv6 only service
|
||||
m.SetQuestion("webv6.service.consul.", dns.TypeA)
|
||||
|
||||
|
@ -2081,4 +2085,9 @@ func TestDNS_NonExistingLookupEmptyAorAAAA(t *testing.T) {
|
|||
if soaRec.Hdr.Ttl != 0 {
|
||||
t.Fatalf("Bad: %#v", in.Ns[0])
|
||||
}
|
||||
|
||||
if in.Rcode != dns.RcodeSuccess {
|
||||
t.Fatalf("Bad: %#v", in)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue