feat: derive host from hostname for plain object targets and bracket IPv6 literals#136
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughsetupOutgoing now builds outgoing.host from outgoing.hostname and outgoing.port when host is missing, adding RFC 3986 brackets for IPv6 literals; tests cover IPv4, IPv6, default-port behavior, and changeOrigin=false preservation. ChangesHost Header Derivation from Hostname and Port
🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
hi @pio |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #136 +/- ##
==========================================
+ Coverage 94.91% 94.93% +0.02%
==========================================
Files 8 8
Lines 786 790 +4
Branches 320 324 +4
==========================================
+ Hits 746 750 +4
Misses 35 35
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
pi0
left a comment
There was a problem hiding this comment.
Thnx and sorry for delay on this!
When a proxy target is passed as a plain
ProxyTargetDetailedobject containing onlyhostname/port/protocol(nohost),setupOutgoingleavesoutgoing.hostasundefined. The subsequentchangeOriginbranch then constructs a malformedHostheader:For IPv6 literals (e.g.
hostname: "::1"), the problem is if a consumer tries to derivehostmanually, RFC 3986 §3.2.2 requires brackets in URI host syntax that aren't present in the bare hostname.Unblock: webpack/webpack-dev-server#5663
Summary by CodeRabbit
Bug Fixes
Tests