Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions common/httpx/httpx.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,17 @@ func New(options *Options) (*HTTPX, error) {
CheckRedirect: redirectFunc,
}, retryablehttpOptions)

// When HTTP/1.1 is explicitly requested, also disable HTTP/2 fallback
// in the retryablehttp client's secondary HTTP client to prevent
// automatic HTTP/2 upgrade on retry (see retryablehttp-go do.go).
if httpx.Options.Protocol == "http11" {
httpx.client.HTTPClient2 = &http.Client{
Transport: transport,
Timeout: httpx.Options.Timeout,
CheckRedirect: redirectFunc,
}
}

transport2 := &http2.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
Expand Down