mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-21 00:21:49 +00:00
test(mcp): assert redirect rejection without SDK wording
This commit is contained in:
parent
064b7d10df
commit
7cd96e9c2d
1 changed files with 2 additions and 1 deletions
|
|
@ -1273,10 +1273,11 @@ async def test_sdk_cross_origin_redirect_never_contacts_destination(operation: s
|
|||
if operation == "list"
|
||||
else client.call_tool(CallToolRequestParams(name="add", arguments={"a": 2, "b": 3}), raise_on_error=True)
|
||||
)
|
||||
with anyio.fail_after(10), pytest.raises(MCPError, match=r"Redirect to .*destination.* not followed"):
|
||||
with anyio.fail_after(10), pytest.raises(MCPError):
|
||||
await pending_operation
|
||||
assert responder.call_count == 1
|
||||
request: Final = responder.call_args.args[0]
|
||||
assert request.method == "POST"
|
||||
assert request.url == "https://upstream.example.com/mcp"
|
||||
assert request.headers["x-upstream-token"] == "Bearer synthetic-token"
|
||||
assert all(call.args[0].url.host != "destination.example.com" for call in responder.call_args_list)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue