Follow redirects only within the MCP endpoint's origin (#3397)
This commit is contained in:
parent
5fd3abc548
commit
c6762e821c
2 changed files with 1029 additions and 205 deletions
|
|
@ -66,7 +66,7 @@ async def main() -> None:
|
|||
scope="user",
|
||||
)
|
||||
|
||||
async with httpx2.AsyncClient(auth=oauth_auth, follow_redirects=True) as http_client:
|
||||
async with httpx2.AsyncClient(auth=oauth_auth) as http_client:
|
||||
async with streamable_http_client("http://localhost:8001/mcp", http_client=http_client) as (read, write):
|
||||
async with ClientSession(read, write) as session:
|
||||
await session.initialize()
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ async def main():
|
|||
callback_handler=handle_callback,
|
||||
)
|
||||
|
||||
async with httpx2.AsyncClient(auth=oauth_auth, follow_redirects=True) as custom_client:
|
||||
async with httpx2.AsyncClient(auth=oauth_auth) as custom_client:
|
||||
async with streamable_http_client("http://localhost:8001/mcp", http_client=custom_client) as (read, write):
|
||||
async with ClientSession(read, write) as session:
|
||||
await session.initialize()
|
||||
|
|
|
|||
Loading…
Reference in a new issue