fix: apply suggested change
I like it so I'm keeping it :)
This commit is contained in:
parent
f22ca2f82f
commit
937d0826e3
1 changed files with 4 additions and 3 deletions
|
@ -16,7 +16,8 @@ import (
|
|||
|
||||
// HTTPSResolver is for DNS-over-HTTPS queries.
|
||||
type HTTPSResolver struct {
|
||||
opts util.Options
|
||||
client http.Client
|
||||
opts util.Options
|
||||
}
|
||||
|
||||
var _ Resolver = (*HTTPSResolver)(nil)
|
||||
|
@ -25,7 +26,7 @@ var _ Resolver = (*HTTPSResolver)(nil)
|
|||
func (resolver *HTTPSResolver) LookUp(msg *dns.Msg) (util.Response, error) {
|
||||
var resp util.Response
|
||||
|
||||
httpR := &http.Client{
|
||||
resolver.client = http.Client{
|
||||
Timeout: resolver.opts.Request.Timeout,
|
||||
Transport: &http.Transport{
|
||||
MaxConnsPerHost: 1,
|
||||
|
@ -56,7 +57,7 @@ func (resolver *HTTPSResolver) LookUp(msg *dns.Msg) (util.Response, error) {
|
|||
req.Header.Set("Accept", "application/dns-message")
|
||||
|
||||
now := time.Now()
|
||||
res, err := httpR.Do(req)
|
||||
res, err := resolver.client.Do(req)
|
||||
resp.RTT = time.Since(now)
|
||||
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue