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
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue