fix: preserve -pr http11 retry behavior (#2240)#2441
fix: preserve -pr http11 retry behavior (#2240)#2441ck3960250 wants to merge 1 commit intoprojectdiscovery:devfrom
Conversation
Neo - PR Security ReviewNo security issues found Highlights
Comment |
WalkthroughAdds HTTP/1.1 protocol support by conditionally disabling HTTP/2 fallback when the protocol option is set to HTTP11. This is achieved by assigning the non-retryable HTTP client to the HTTP/2 fallback client. Includes a corresponding test. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
common/httpx/httpx.go (1)
186-189: Use theHTTP11constant instead of string literal at lines 156 and 186.The
HTTP11constant is defined incommon/httpx/proto.goand is correctly used in the test file, but lines 156 and 186 use the string literal"http11"directly. For consistency and to avoid potential bugs if the constant value changes, both locations should use the constant.♻️ Suggested fixes
Line 156:
- if httpx.Options.Protocol == "http11" { + if httpx.Options.Protocol == HTTP11 { // disable http2Line 186:
- if httpx.Options.Protocol == "http11" { + if httpx.Options.Protocol == HTTP11 { // keep retry fallback on the same client so explicit HTTP/1.1 is preserved🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@common/httpx/httpx.go` around lines 186 - 189, Replace the hard-coded protocol string "http11" with the HTTP11 constant from common/httpx/proto.go to ensure consistency; update the checks that inspect httpx.Options.Protocol (and the branch that sets httpx.client.HTTPClient2 when protocol is http11) to compare against HTTP11 instead of the literal, keeping all behavior identical but using the defined HTTP11 symbol.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@common/httpx/httpx.go`:
- Around line 186-189: Replace the hard-coded protocol string "http11" with the
HTTP11 constant from common/httpx/proto.go to ensure consistency; update the
checks that inspect httpx.Options.Protocol (and the branch that sets
httpx.client.HTTPClient2 when protocol is http11) to compare against HTTP11
instead of the literal, keeping all behavior identical but using the defined
HTTP11 symbol.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9becbf8d-9270-4711-8c33-9a4fbc174a9d
📒 Files selected for processing (2)
common/httpx/httpx.gocommon/httpx/httpx_test.go
|
Friendly ping! This PR is ready for review. All checks have passed (Neo ✓, CodeRabbit ✓). Happy to address any feedback. |
/claim #2240
Proposed Changes
Proof
Checklist
Summary by CodeRabbit