fix: disable HTTP/2 fallback when -pr http11 is set#2409
fix: disable HTTP/2 fallback when -pr http11 is set#2409285729101 wants to merge 3 commits intoprojectdiscovery:mainfrom
Conversation
bump version to v1.8.1 (projectdiscovery#2381)
When the user explicitly requests HTTP/1.1 via the -pr http11 flag, httpx correctly configures the primary transport to disable HTTP/2. However, retryablehttp-go's internal HTTPClient2 (used as a fallback on certain HTTP/1.x errors) still has HTTP/2 enabled, causing the protocol preference to be silently ignored. This fix overrides the retryablehttp fallback client (HTTPClient2) with an HTTP/1.1-only transport when -pr http11 is specified, ensuring the user's protocol preference is fully respected. Fixes projectdiscovery#2240
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
7f1f86c to
0212fd7
Compare
|
@Ice3man543 alternative approach for the HTTP/1.1 flag fix — disables HTTP/2 at the transport level. |
|
Hi, thanks for your interest in contributing! Just a heads up, we ask contributors to work on 1 active issue at a time (see). Also, we welcome AI-assisted development, but submissions must be complete, tested, and ready to merge. Please also make sure to fill out the PR template with proof that your changes work. We're closing this PR along with your other open submissions. Once you're ready, feel free to pick one issue to focus on and resubmit; we'd be happy to review it. Appreciate your understanding! |
Summary
HTTPClient2fallback client with an HTTP/1.1-only transport when-pr http11is explicitly specifiedmalformed HTTP versionerrors, which was causing the-pr http11flag to be ignoredTLSNextPrototo an empty map to fully disable HTTP/2 negotiation on the fallback clientTest plan
go build ./...compiles successfullygo test ./common/httpx/...passeshttpx -u <target> -pr http11against an HTTP/2 server and confirm only HTTP/1.1 is used-pr http11) behavior is unaffected and HTTP/2 fallback still works/claim #2240
🤖 Generated with Claude Code