diff --git a/admin/benchmarker/request.go b/admin/benchmarker/request.go index 4a3a7538..843f88e1 100644 --- a/admin/benchmarker/request.go +++ b/admin/benchmarker/request.go @@ -12,6 +12,7 @@ import ( "time" "github.com/PuerkitoBio/goquery" + "golang.org/x/net/http2" ) func getInitialize() { @@ -74,6 +75,9 @@ func httpsRequest(method string, path string, params url.Values) int { tr := &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } + if err := http2.ConfigureTransport(tr); err != nil { + log.Fatalf("Failed to configure h2 transport: %s", err) + } req.Header.Set("Content-Type", "application/x-www-form-urlencoded") client := http.Client{Transport: tr} @@ -92,6 +96,9 @@ func httpsRequestDoc(method string, path string, params url.Values) *goquery.Doc tr := &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } + if err := http2.ConfigureTransport(tr); err != nil { + log.Fatalf("Failed to configure h2 transport: %s", err) + } req.Header.Set("Content-Type", "application/x-www-form-urlencoded") client := http.Client{Transport: tr}