Fix resolving CNAME with no proxy (#564)
This fixes a crash when we resolve (or try to) an external CNAME when no proxy is set. Add test as well.
This commit is contained in:
parent
a3f7788686
commit
6966bce653
11 changed files with 67 additions and 9 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/coredns/coredns/middleware/proxy"
|
||||
"github.com/coredns/coredns/middleware/test"
|
||||
"github.com/coredns/coredns/request"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
|
||||
|
@ -18,7 +19,7 @@ func TestZoneReload(t *testing.T) {
|
|||
|
||||
name, rm, err := TempFile(".", exampleOrg)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to created zone: %s", err)
|
||||
t.Fatalf("Failed to create zone: %s", err)
|
||||
}
|
||||
defer rm()
|
||||
|
||||
|
@ -47,7 +48,7 @@ example.net:0 {
|
|||
|
||||
resp, err := p.Lookup(state, "example.org.", dns.TypeA)
|
||||
if err != nil {
|
||||
t.Fatal("Expected to receive reply, but didn't")
|
||||
t.Fatalf("Expected to receive reply, but didn't: %s", err)
|
||||
}
|
||||
if len(resp.Answer) != 2 {
|
||||
t.Fatalf("Expected two RR in answer section got %d", len(resp.Answer))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue