Don't assume that A RRs will be first

Maybe
fixes #202
This commit is contained in:
Frank Denis 2018-03-02 12:28:24 +01:00
parent 2c7513a2c8
commit 4e671cf5ef
1 changed files with 1 additions and 1 deletions

View File

@ -155,7 +155,7 @@ func (xTransport *XTransport) Fetch(method string, url *url.URL, accept string,
var foundIP *string var foundIP *string
for _, answer := range in.Answer { for _, answer := range in.Answer {
if answer.Header().Rrtype == dns.TypeA { if answer.Header().Rrtype == dns.TypeA {
foundIPx := in.Answer[0].(*dns.A).A.String() foundIPx := answer.(*dns.A).A.String()
foundIP = &foundIPx foundIP = &foundIPx
break break
} }