parent
ddbf40de9a
commit
3d7b4a9821
|
@ -80,6 +80,14 @@ func (r *DOHResolver) Lookup(question dns.Question) (Response, error) {
|
||||||
return rsp, fmt.Errorf("error from nameserver %s", resp.Status)
|
return rsp, fmt.Errorf("error from nameserver %s", resp.Status)
|
||||||
}
|
}
|
||||||
rtt := time.Since(now)
|
rtt := time.Since(now)
|
||||||
|
// if debug, extract the response headers
|
||||||
|
if r.resolverOptions.Logger.IsLevelEnabled(logrus.DebugLevel) {
|
||||||
|
for header, value := range resp.Header {
|
||||||
|
r.resolverOptions.Logger.WithFields(logrus.Fields{
|
||||||
|
header: value,
|
||||||
|
}).Debug("DOH response header")
|
||||||
|
}
|
||||||
|
}
|
||||||
// extract the binary response in DNS Message.
|
// extract the binary response in DNS Message.
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue