[mcp] fix: reject encoded leading-slash routes - #248
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces handling for HTTP encoded leading-slash routes (such as /%2Fapi/gpus and /%2Frpc) to ensure they are correctly classified as noncanonical and rejected with a structured JSON 404 error instead of falling back to static-file handlers or leaking HTML errors. The changes include adding a _route_path_candidates helper in the MCP server to generate and check unquoted and collapsed path candidates, updating documentation in AGENTS.md and docs/guides/mcp.md, adding an implementation plan, and expanding the test suite with corresponding regression tests. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
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 (5)
📝 WalkthroughWalkthroughThis PR adds a shared ChangesEncoded route detection and docs
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Summary
Verification
Summary by CodeRabbit
Bug Fixes
404 Unknown endpointresponses./rpcand/api/...variants from falling through to unintended behavior, including static or dashboard handling.Documentation