fix: preserve path when target includes path#139
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 (2)
📝 WalkthroughWalkthroughThis PR fixes a regression where ChangesRoot Path Joining Fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 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 |
|
Copilot shouldn't have modified existing tests. |
|
Thanks for PR. Do you prefer to revert last patch? behavior change was kinda known behavior change in #137 |
|
Hi @pi0 Think reverting the last patch makes sense, since some url With Some projects like After reverting the patch. This missing unit test can be added to guard the specific proxy configuration/behaviour. it("should not add trailing slash when target has base path and request path is root", () => {
const outgoing = createOutgoing();
common.setupOutgoing(
outgoing,
{
target: URL.parse("http://localhost/api")!,
},
stubIncomingMessage({ url: "/" }),
);
expect(outgoing.path).to.eql("/api");
}); |
regression introduced in #137
fixes #138
tested patch in chimurai/http-proxy-middleware#1234
When target is configured with path the outgoing path is not preserved:
(in 0.5.2 a trailing slash is added)
Reproduction:
Summary by CodeRabbit