Validate HTTP/2 header casing and lowercase default user-agent - #22
Validate HTTP/2 header casing and lowercase default user-agent#22vincenthawke wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 40 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. 📝 WalkthroughWalkthroughThe client now uses a lowercase ChangesHTTP Header Validation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/index.ts`:
- Around line 565-573: Update the header validation condition near allHeaders so
validation runs whenever options.forceHttp1 is not true, including when it is
omitted, while still skipping it for explicit true. Add tests covering omitted
forceHttp1 and uppercase defaultHeaders/connectHeaders, explicit false, and
explicit true.
- Line 511: Update the README defaultHeaders example to use the lowercase
`user-agent` header key instead of `User-Agent`, keeping the documented
`forceHttp1: false` configuration unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Added HTTP/2 header casing validation to the
SessionClientconstructor. WhenforceHttp1isfalse, bothdefaultHeadersandconnectHeadersare checked, and an error is thrown if any header name is not lowercase.Renamed the
user-agentheader inDEFAULT_OPTIONS.defaultHeadersto lowercase.No header casing validation is performed when
forceHttp1istrue, since HTTP/1.1 does not require lowercase header namesSummary by CodeRabbit
User-Agentheader key to lowercase.