Conversation
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
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 |
…roxy - Replace `Object.create(req)` with header defaults merged under `opts.headers` - Omit `x-forwarded-for` when the socket has no `remoteAddress` - Drop implementation-specific read-only/setter tests - Note that `x-forwarded-port` derives from client-controlled `Host` - Fix stale `upgrade.ts` references in AGENTS.md
|
Thanks for the PR! I've pushed a follow-up commit with some changes to the
New tests cover a spoofed Note This review and follow-up commit were generated with an AI assistant. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #171 +/- ##
==========================================
+ Coverage 95.03% 95.16% +0.13%
==========================================
Files 8 8
Lines 805 827 +22
Branches 331 339 +8
==========================================
+ Hits 765 787 +22
Misses 35 35
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Adds
xfwd: "replace"to standaloneproxyUpgradefor applications that want to discard the incoming forwarding chain.The mode removes incoming
ForwardedandX-Forwarded-*fields and generates new forwarding values from the incoming socket. The address comes fromremoteAddress, the port fromlocalPortwith an80/443fallback, and the protocol from the socket's encryption. It does not use the client-controlledHostport. Caller-suppliedheaderstake precedence case-insensitively in every mode, including replacement.Default and
truemodes append forwarding values;falseadds none. A missing remote address does not generate anx-forwarded-forvalue. Forwarding does not mutate the incoming request headers or raw headers.Verification
pnpm vitest run test/ws.test.tspnpm testpnpm build