File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1313from starlette .routing import Mount , Route
1414
1515from mcp .client .session import ClientSession
16- from mcp .client .sse import sse_client
16+ from mcp .client .sse import sse_client , remove_request_params
1717from mcp .server import Server
1818from mcp .server .sse import SseServerTransport
1919from mcp .shared .exceptions import McpError
@@ -250,3 +250,14 @@ async def test_sse_client_timeout(
250250 return
251251
252252 pytest .fail ("the client should have timed out and returned an error already" )
253+
254+
255+ def test_remove_request_params ():
256+ # Removes query parameters
257+ assert remove_request_params ('http://example.com/test?foo=bar' ) == 'http://example.com/test'
258+ # Removes fragment
259+ assert remove_request_params ('http://example.com/test#section' ) == 'http://example.com/test'
260+ # Leaves clean URL unchanged
261+ assert remove_request_params ('http://example.com/test' ) == 'http://example.com/test'
262+ # Works with path only
263+ assert remove_request_params ('/test/path?x=1' ) == '/test/path'
You can’t perform that action at this time.
0 commit comments