fix(web-outgoing): handle object target in redirect host rewrite#108
fix(web-outgoing): handle object target in redirect host rewrite#108
Conversation
When `options.target` is a `ProxyTargetDetailed` object (not a string or URL), `setRedirectHostRewrite` crashed with `Invalid URL` because `new URL()` cannot parse a plain object. Construct the URL from the object's `protocol`, `host`/`hostname`, and `port` properties instead. Upstream: http-party/node-http-proxy#1600
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #108 +/- ##
==========================================
+ Coverage 96.14% 96.20% +0.05%
==========================================
Files 8 8
Lines 623 632 +9
Branches 233 237 +4
==========================================
+ Hits 599 608 +9
Misses 24 24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
options.targetis aProxyTargetDetailedobject (not a string orURL) and thesetRedirectHostRewritemiddleware runs on a redirect responsenew URL()constructor was called with a plain object, which throwsInvalid URL; now constructs the URL from the object'sprotocol,host/hostname, andportpropertiesURLinstance targetsUpstream: http-party/node-http-proxy#1600
Test plan
setRedirectHostRewritewithProxyTargetDetailedobject targetsetRedirectHostRewritewithURLinstance target