refactor: respect disabled HTTP/2 during retries#523
Closed
AliakbarArshadi wants to merge 1 commit intoprojectdiscovery:mainfrom
Closed
refactor: respect disabled HTTP/2 during retries#523AliakbarArshadi wants to merge 1 commit intoprojectdiscovery:mainfrom
AliakbarArshadi wants to merge 1 commit intoprojectdiscovery:mainfrom
Conversation
- Implemented isHTTP2Disabled check to detect GODEBUG and TLSNextProto settings. - Prevented automatic fallback to HTTPClient2 when HTTP/2 is explicitly disabled. - Added comprehensive regression tests for protocol restriction scenarios. Fixes #2240
Member
|
The underlying issue (httpx#2240) has been resolved at the httpx level — the HTTP/1.1 protocol preference is now correctly enforced without requiring changes to retryablehttp-go. Closing as the original bounty issue is already complete. Thanks for the contribution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the issue where
retryablehttpwould ignore user-forced HTTP/1.1 settings and incorrectly fall back to HTTP/2 during retries.Fixes #2240
Proposed changes
isHTTP2Disabled()method to detect protocol restrictions viaGODEBUG=http2client=0or emptyTLSNextProtomaps.do.goto skip theHTTPClient2fallback if HTTP/2 is disabled.Proof
TestClient_HTTP2Fallback_Disabledcovering:TLSNextProtois empty.GODEBUGis set.go test -v ./....Checklist