mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
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:
@@ -142,6 +142,10 @@ func (p Proxy) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
|
||||
}
|
||||
|
||||
func (p Proxy) match(state request.Request) (u Upstream) {
|
||||
if p.Upstreams == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
longestMatch := 0
|
||||
for _, upstream := range *p.Upstreams {
|
||||
from := upstream.From()
|
||||
|
||||
Reference in New Issue
Block a user