[mcp] fix: reject encoded rpc aliases - #228
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
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 (6)
📝 WalkthroughWalkthroughThe ChangesEncoded /rpc Alias Rejection
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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
/rpcaliases such as/rp%63and/%72pcas structured JSON404 Unknown endpoint/rpcbehavior as the canonical POST-only JSON-RPC endpoint with structured405for unsupported methodsVerification
PYTHONPATH=$PWD/src pytest tests/mcp/test_http_api.py -q -k 'http_rpc_noncanonical_get_returns_json_404_without_static_fallback or http_rpc_encoded_exact_alias'failed with 4 expected failures before the fixPYTHONPATH=$PWD/src pytest tests/mcp/test_http_api.py -q -k 'http_rpc_noncanonical_get_returns_json_404_without_static_fallback or http_rpc_encoded_exact_alias or http_rpc_get_rejects_with_json_405 or http_jsonrpc_parse_error_returns_jsonrpc_envelope'passed with 13 passedPYTHONPATH=$PWD/src pytest tests/mcp/test_http_api.py -qpassed with 121 passedPYTHONPATH=$PWD/src pytest tests -qpassed with 862 passed, 11 skippedPYTHONPATH=$PWD/src mkdocs build --strictpassed with the existing Material for MkDocs warningpre-commit run --all-files --show-diff-on-failurepassedgit diff --checkpassedLocal Review
Summary by CodeRabbit
Bug Fixes
/rpcURLs now return a structured404 Unknown endpointresponse.Documentation
/rpcURL forms are treated as invalid.