You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
-pr http11 flag is ignored on retryablehttp-go due to HTTP/2 fallback #2240
When using HTTP 1.1, change transport, and it will use retryablehttp
But if we see retryablehttp repo do.go 62 line
// if err is equal to missing minor protocol version retry with http/2iferr!=nil&&stringsutil.ContainsAny(err.Error(), "net/http: HTTP/1.x transport connection broken: malformed HTTP version \"HTTP/2\"", "net/http: HTTP/1.x transport connection broken: malformed HTTP response") {
resp, err=c.HTTPClient2.Do(req.Request)
checkOK, checkErr=c.CheckRetry(req.Context(), resp, err)
}
This issue is caused by the retry behavior in retryablehttp-go, as discussed in projectdiscovery/retryablehttp-go#3.
If httpx set client for using only http1.1 but retryable use another client in this case so -pr does not work correctly.
Expected Behavior:
Use transport change client when httpx -pr is on
Suggestion
Add Options.DisableHTTPFallback (Example). If set, skip the HTTP/2 fallback (HTTPClient2) on malformed HTTP/2 errors and treat them according to the retry policy.
This respects explicit HTTP/1.1-only configs and avoids unintended protocol switches and policy divergence (proxy/dialer/redirect/TLS)
Claim attempt: Comment /attempt #2240 on this issue. Multiple participants can attempt, but only the first to submit a complete, mergeable solution will receive the reward.
Work on the issue: Follow the Contribution Guidelines and ensure your solution fully addresses the issue requirements.
Submit your PR: Open a pull request to projectdiscovery/httpx and include /claim #2240 in the PR body.
Receive payment: Upon successful merge, you will receive 100% of the bounty through Algora within 2-5 days.
Thank you for contributing to projectdiscovery/httpx and helping us democratize security!
PR Requirements
Your PR must include the following. PRs that don't meet these requirements may not be reviewed and could be closed.
Proposed Changes
Describe the overall picture of your modifications to help maintainers understand the pull request.
Proof
Demonstrate your changes work. Include before/after examples, screenshots, or terminal output showing the fix/feature in action.
Checklist
PR created against the correct branch (usually dev)
All checks passed (lint, unit/integration/regression tests)
Tests added that prove the fix is effective or feature works
Hey contributors! Please make sure your PR follows the PR template and includes proof that your changes work (before/after examples, screenshots, or terminal output). Reviewer time is limited! Incomplete PRs may be closed without review. Thanks!
/attempt #2240
Plan: reproduce being ignored on retry fallback, enforce protocol pinning across retries, add a regression test to ensure no HTTP/2 fallback when http11 is requested, then submit PR with /claim #2240.
/attempt #2240
Plan: reproduce the http11 protocol flag being ignored on retry fallback, enforce protocol pinning across retries, add a regression test to ensure no HTTP/2 fallback when http11 is requested, then submit PR with /claim #2240.
Implementation Plan: Fix -pr http11 Flag Being Ignored Due to HTTP/2 Fallback
Problem
When httpx is configured with -pr http11 (HTTP/1.1 only), retryablehttp-go silently falls back to HTTP/2 via HTTPClient2 when it encounters malformed HTTP/2 errors. This defeats the explicit protocol restriction.
Root Cause
In retryablehttp-go/do.go line 62, when an HTTP/1.1 request fails with a malformed HTTP/2 error, the code unconditionally retries with c.HTTPClient2 regardless of whether the caller explicitly restricted to HTTP/1.1.
Fix
Add DisableHTTPFallback option to retryablehttp-go:
New field in retryablehttp.Options: DisableHTTPFallback bool
When set to true, skip the HTTP/2 fallback in do.go and treat the error according to normal retry policy
This is the cleanest fix as suggested by the issue reporter
Wire it up in httpx:
In common/httpx/httpx.go, when Options.Protocol == "http11", also set DisableHTTPFallback: true on the retryablehttp client
This ensures the -pr flag is fully respected
Files to modify:
retryablehttp-go: options.go (add field), do.go (check flag before fallback)
httpx: common/httpx/httpx.go (set flag when protocol is restricted)
Testing:
Test with a server that responds with HTTP/2 when HTTP/1.1 is requested
Hi - I reviewed "pr http11 flag is ignored on retryablehttp-go due to HTTP/2 fallback" and prepared a reviewready draft with reproduction notes and a clear scope (targeting the exact behavior in #2240). This gives you something concrete to validate immediately, rather than a vague pitch.
Problem summary (current draft): the -pr http11 flag is ignored when retryablehttp-go falls back to HTTP/2, creating unexpected protocol behavior. The draft focuses on reproducible steps, expected vs. actual behavior, and the minimum conditions needed to trigger the fallback.
What I'll build next:
Tighten the reproduction steps into a short, copypasteable flow.
Package the report for a clear bounty review and quick triage.
Timeline:
Day 1: reviewready draft + reproduction flow refined
Day 2: polish + submissionready package
Credibility: I've delivered similar security writeups, including a working prototype artifact showing execution readiness, and I prioritize reproducibility and scoped fixes. I'll route through Github_Bounties and keep everything tight and testable.
If you want me to proceed, send any constraints (env details, preferred format, or expected impact framing), and I'll tighten the draft immediately.
Quick review checklist (for your input):
Scope accurate to the issue?
Repro steps clear enough to run in one pass?
Expected vs. actual behavior stated plainly?
Any extra edge cases to include?
Nicholas C. (Queenstown, New Zealand)
I already have a working draft prepared and can refine it quickly if you'd like me to proceed.
Hi - I reviewed "pr http11 flag is ignored on retryablehttp-go due to HTTP/2 fallback" and prepared a reviewready draft with reproduction notes and a clear scope (targeting the exact behavior in #2240). This gives you something concrete to validate immediately, rather than a vague pitch.
Problem summary (current draft): the -pr http11 flag is ignored when retryablehttp-go falls back to HTTP/2, creating unexpected protocol behavior. The draft focuses on reproducible steps, expected vs. actual behavior, and the minimum conditions needed to trigger the fallback.
What I'll build next:
Tighten the reproduction steps into a short, copypasteable flow.
Package the report for a clear bounty review and quick triage.
Timeline:
Day 1: reviewready draft + reproduction flow refined
Day 2: polish + submissionready package
Credibility: I've delivered similar security writeups, including a working prototype artifact showing execution readiness, and I prioritize reproducibility and scoped fixes. I'll route through Github_Bounties and keep everything tight and testable.
If you want me to proceed, send any constraints (env details, preferred format, or expected impact framing), and I'll tighten the draft immediately.
Quick review checklist (for your input):
Scope accurate to the issue?
Repro steps clear enough to run in one pass?
Expected vs. actual behavior stated plainly?
Any extra edge cases to include?
Nicholas C. (Queenstown, New Zealand)
I already have a working draft prepared and can refine it quickly if you'd like me to proceed.
Activity
dogancanbakir commentedon Feb 2, 2026
/bounty $100
algora-pbc commentedon Feb 2, 2026
💎 $100 bounty • ProjectDiscovery Bounty Available
How to Participate:
/attempt #2240on this issue. Multiple participants can attempt, but only the first to submit a complete, mergeable solution will receive the reward./claim #2240in the PR body.Thank you for contributing to projectdiscovery/httpx and helping us democratize security!
PR Requirements
Your PR must include the following. PRs that don't meet these requirements may not be reviewed and could be closed.
Proposed Changes
Describe the overall picture of your modifications to help maintainers understand the pull request.
Proof
Demonstrate your changes work. Include before/after examples, screenshots, or terminal output showing the fix/feature in action.
Checklist
dev)Add a bounty • Share on socials
feat: Add DisableHTTP2 option to respect HTTP/1.1-only preference
fix: Respect DisableHTTP2 option in HTTP/2 fallback logic
docs: Add implementation guide for HTTP/1.1-only fix
docs: Add comprehensive README for issue projectdiscovery#2240 fix
1234-ad commentedon Feb 2, 2026
Fix Submitted! 🎉
I've analyzed the issue and submitted a comprehensive fix across two repositories:
Root Cause
The
-pr http11flag was being ignored because:Solution
PR #521 to retryablehttp-go: projectdiscovery/retryablehttp-go#521
DisableHTTP2option to prevent automatic HTTP/2 fallbackPR #2387 to httpx: #2387
DisableHTTP2 = truewhen-pr http11is specifiedThe Fix (5 lines of code)
In
common/httpx/httpx.go, after line 79:Testing
Before:
$ httpx -u https://example.com -pr http11 # HTTP/2 used despite flag ❌After:
$ httpx -u https://example.com -pr http11 # Only HTTP/1.1 used ✅Benefits
✅ Honors user intent
✅ Backward compatible
✅ Clean solution
✅ Well documented
Both PRs are ready for review!
fix: respect -pr http11 flag by disabling HTTP/2 fallback in retryabl…
dogancanbakir commentedon Feb 3, 2026
Hey contributors! Please make sure your PR follows the PR template and includes proof that your changes work (before/after examples, screenshots, or terminal output). Reviewer time is limited! Incomplete PRs may be closed without review. Thanks!
khs-alt commentedon Feb 3, 2026
/attempt #2240
thecafetron-ctrl commentedon Feb 7, 2026
/attempt #2240
thecafetron-ctrl commentedon Feb 7, 2026
Implemented fix + PR opened:
Proof:
/claim #2240
45 remaining items
Tianlin0725 commentedon Mar 6, 2026
/attempt #2240
Plan: reproduce being ignored on retry fallback, enforce protocol pinning across retries, add a regression test to ensure no HTTP/2 fallback when http11 is requested, then submit PR with /claim #2240.
Tianlin0725 commentedon Mar 6, 2026
/attempt #2240
Plan: reproduce the http11 protocol flag being ignored on retry fallback, enforce protocol pinning across retries, add a regression test to ensure no HTTP/2 fallback when http11 is requested, then submit PR with /claim #2240.
ck3960250 commentedon Mar 7, 2026
/attempt #2240
Merge-first plan:
ck3960250 commentedon Mar 7, 2026
PR opened: #2441
Includes /claim #2240, narrow fix, and regression test.
innerpeace609 commentedon Mar 9, 2026
/attempt #2240
fix: preserve -pr http11 across retryablehttp-go fallback (projectdis…
drmabus commentedon Mar 19, 2026
PR #2456 implements a complete fix for this issue.
It ensures that when
-pr http11is specified, HTTP/1.1 is strictly enforced and no HTTP/2 fallback occurs during retryablehttp transport errors.This resolves the unintended protocol downgrade by reusing the HTTP/1.1-only client across retries.
Closes #2240
chengyixu commentedon Mar 19, 2026
/attempt #2240
Implementation Plan: Fix -pr http11 Flag Being Ignored Due to HTTP/2 Fallback
Problem
When httpx is configured with
-pr http11(HTTP/1.1 only), retryablehttp-go silently falls back to HTTP/2 viaHTTPClient2when it encounters malformed HTTP/2 errors. This defeats the explicit protocol restriction.Root Cause
In
retryablehttp-go/do.goline 62, when an HTTP/1.1 request fails with a malformed HTTP/2 error, the code unconditionally retries withc.HTTPClient2regardless of whether the caller explicitly restricted to HTTP/1.1.Fix
Add
DisableHTTPFallbackoption to retryablehttp-go:retryablehttp.Options:DisableHTTPFallback booltrue, skip the HTTP/2 fallback indo.goand treat the error according to normal retry policyWire it up in httpx:
common/httpx/httpx.go, whenOptions.Protocol == "http11", also setDisableHTTPFallback: trueon the retryablehttp client-prflag is fully respectedFiles to modify:
retryablehttp-go:options.go(add field),do.go(check flag before fallback)httpx:common/httpx/httpx.go(set flag when protocol is restricted)Testing:
-pr http11Will submit PR against
devbranch.algora-pbc commentedon Mar 19, 2026
@Veirt: You've been awarded a $100 by ProjectDiscovery! 👉 Complete your Algora onboarding to collect the bounty.
algora-pbc commentedon Mar 19, 2026
🎉🎈 @Veirt has been awarded $100 by ProjectDiscovery! 🎈🎊
zhaog100 commentedon Mar 19, 2026
/attempt
I'll look into the http11 flag being ignored due to HTTP/2 fallback.
Nikolias-Ai commentedon Mar 21, 2026
Hi - I reviewed "pr http11 flag is ignored on retryablehttp-go due to HTTP/2 fallback" and prepared a reviewready draft with reproduction notes and a clear scope (targeting the exact behavior in #2240). This gives you something concrete to validate immediately, rather than a vague pitch.
Problem summary (current draft): the
-pr http11flag is ignored when retryablehttp-go falls back to HTTP/2, creating unexpected protocol behavior. The draft focuses on reproducible steps, expected vs. actual behavior, and the minimum conditions needed to trigger the fallback.What I'll build next:
Timeline:
Credibility: I've delivered similar security writeups, including a working prototype artifact showing execution readiness, and I prioritize reproducibility and scoped fixes. I'll route through Github_Bounties and keep everything tight and testable.
If you want me to proceed, send any constraints (env details, preferred format, or expected impact framing), and I'll tighten the draft immediately.
Quick review checklist (for your input):
Scope accurate to the issue?
Repro steps clear enough to run in one pass?
Expected vs. actual behavior stated plainly?
Any extra edge cases to include?
Nicholas C. (Queenstown, New Zealand)
I already have a working draft prepared and can refine it quickly if you'd like me to proceed.
Nikolias-Ai commentedon Mar 26, 2026
Hi - I reviewed "pr http11 flag is ignored on retryablehttp-go due to HTTP/2 fallback" and prepared a reviewready draft with reproduction notes and a clear scope (targeting the exact behavior in #2240). This gives you something concrete to validate immediately, rather than a vague pitch.
Problem summary (current draft): the
-pr http11flag is ignored when retryablehttp-go falls back to HTTP/2, creating unexpected protocol behavior. The draft focuses on reproducible steps, expected vs. actual behavior, and the minimum conditions needed to trigger the fallback.What I'll build next:
Timeline:
Credibility: I've delivered similar security writeups, including a working prototype artifact showing execution readiness, and I prioritize reproducibility and scoped fixes. I'll route through Github_Bounties and keep everything tight and testable.
If you want me to proceed, send any constraints (env details, preferred format, or expected impact framing), and I'll tighten the draft immediately.
Quick review checklist (for your input):
Scope accurate to the issue?
Repro steps clear enough to run in one pass?
Expected vs. actual behavior stated plainly?
Any extra edge cases to include?
Nicholas C. (Queenstown, New Zealand)
I already have a working draft prepared and can refine it quickly if you'd like me to proceed.