proxy: preserve trailing slash through path.Join and strip_path#1272
proxy: preserve trailing slash through path.Join and strip_path#1272c-tonneslan wants to merge 1 commit into
Conversation
Closes ory#1266. The switch to path.Join in ConfigureBackendURL drops any trailing slash from the proxied path. Combined with the existing strip_path strings.Replace, a request to /some/path/ with strip_path /some ended up at /path on the upstream instead of /path/. Remember whether the inbound path had a trailing slash and put it back after the strip step. Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR restores trailing slash semantics in upstream requests that were inadvertently lost when ChangesTrailing Slash Preservation in Proxy Path Forwarding
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
|
I posted a similar MR (#1269) last month, but got no reaction from the team. I'm hoping the maintainers recognize this problem soon. |
Closes #1266.
The switch to
path.JoininConfigureBackendURLdrops a trailing slash from the proxied path. Combined with the existingstrip_pathstrings.Replace, a request to/some/path/withstrip_path: /someended up at/pathon the upstream instead of/path/.Remember whether the inbound path had a trailing slash and add it back after the strip step. Two regression cases added to
TestConfigureBackendURL.Summary by CodeRabbit
Bug Fixes
Tests