Skip to content

Commit

Permalink
Merge branch 'master' into issue/763
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Jul 12, 2020
2 parents c2acb5b + 1e211d5 commit 7265588
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions netx/resolver/dnsoverhttps.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"io/ioutil"
"net/http"
"time"

"github.com/ooni/probe-engine/internal/httpheader"
)
Expand All @@ -25,6 +26,8 @@ func NewDNSOverHTTPS(client *http.Client, URL string) DNSOverHTTPS {

// RoundTrip implements RoundTripper.RoundTrip.
func (t DNSOverHTTPS) RoundTrip(ctx context.Context, query []byte) ([]byte, error) {
ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()
req, err := http.NewRequest("POST", t.URL, bytes.NewReader(query))
if err != nil {
return nil, err
Expand Down

0 comments on commit 7265588

Please sign in to comment.