Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion tests/shared/test_sse.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from starlette.routing import Mount, Route

from mcp.client.session import ClientSession
from mcp.client.sse import sse_client
from mcp.client.sse import remove_request_params, sse_client
from mcp.server import Server
from mcp.server.sse import SseServerTransport
from mcp.shared.exceptions import McpError
Expand Down Expand Up @@ -250,3 +250,14 @@ async def test_sse_client_timeout(
return

pytest.fail("the client should have timed out and returned an error already")


def test_remove_request_params():
# Removes query parameters
assert remove_request_params('http://example.com/test?foo=bar') == 'http://example.com/test'
# Removes fragment
assert remove_request_params('http://example.com/test#section') == 'http://example.com/test'
# Leaves clean URL unchanged
assert remove_request_params('http://example.com/test') == 'http://example.com/test'
# Works with path only
assert remove_request_params('/test/path?x=1') == '/test/path'
Loading