Follow redirects only within the MCP endpoint's origin (#3397)
This commit is contained in:
parent
5fd3abc548
commit
c6762e821c
4 changed files with 1029 additions and 205 deletions
|
|
@ -8,7 +8,6 @@ async def main() -> None:
|
|||
async with httpx2.AsyncClient(
|
||||
headers={"Authorization": "Bearer ..."},
|
||||
timeout=httpx2.Timeout(30.0, read=300.0),
|
||||
follow_redirects=True,
|
||||
) as http_client:
|
||||
transport = streamable_http_client("http://localhost:8000/mcp", http_client=http_client)
|
||||
async with Client(transport) as client:
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ oauth = IdentityAssertionOAuthProvider(
|
|||
|
||||
|
||||
async def main() -> None:
|
||||
async with httpx2.AsyncClient(auth=oauth, follow_redirects=True) as http_client:
|
||||
async with httpx2.AsyncClient(auth=oauth) as http_client:
|
||||
transport = streamable_http_client("http://localhost:8001/mcp", http_client=http_client)
|
||||
async with Client(transport) as client:
|
||||
result = await client.list_tools()
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ oauth = OAuthClientProvider(
|
|||
|
||||
|
||||
async def main() -> None:
|
||||
async with httpx2.AsyncClient(auth=oauth, follow_redirects=True) as http_client:
|
||||
async with httpx2.AsyncClient(auth=oauth) as http_client:
|
||||
transport = streamable_http_client("http://localhost:8001/mcp", http_client=http_client)
|
||||
async with Client(transport) as client:
|
||||
result = await client.list_tools()
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ oauth = ClientCredentialsOAuthProvider(
|
|||
|
||||
|
||||
async def main() -> None:
|
||||
async with httpx2.AsyncClient(auth=oauth, follow_redirects=True) as http_client:
|
||||
async with httpx2.AsyncClient(auth=oauth) as http_client:
|
||||
transport = streamable_http_client("http://localhost:8001/mcp", http_client=http_client)
|
||||
async with Client(transport) as client:
|
||||
result = await client.list_tools()
|
||||
|
|
|
|||
Loading…
Reference in a new issue