File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 13
13
from starlette .routing import Mount , Route
14
14
15
15
from mcp .client .session import ClientSession
16
- from mcp .client .sse import sse_client
16
+ from mcp .client .sse import sse_client , remove_request_params
17
17
from mcp .server import Server
18
18
from mcp .server .sse import SseServerTransport
19
19
from mcp .shared .exceptions import McpError
@@ -250,3 +250,14 @@ async def test_sse_client_timeout(
250
250
return
251
251
252
252
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