From 9623ef43606caa3c482c31561c7c10e013a7a91a Mon Sep 17 00:00:00 2001 From: Bela Vizi Date: Wed, 2 Jul 2025 17:59:56 +0200 Subject: [PATCH] add trust env to clientsession --- backend/open_webui/retrieval/loaders/mistral.py | 1 + backend/open_webui/routers/auths.py | 2 +- backend/open_webui/routers/functions.py | 2 +- backend/open_webui/routers/tools.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/retrieval/loaders/mistral.py b/backend/open_webui/retrieval/loaders/mistral.py index b00e9d7ce5..b7f2622f5e 100644 --- a/backend/open_webui/retrieval/loaders/mistral.py +++ b/backend/open_webui/retrieval/loaders/mistral.py @@ -507,6 +507,7 @@ class MistralLoader: timeout=timeout, headers={"User-Agent": "OpenWebUI-MistralLoader/2.0"}, raise_for_status=False, # We handle status codes manually + trust_env=True, ) as session: yield session diff --git a/backend/open_webui/routers/auths.py b/backend/open_webui/routers/auths.py index 60a12db4b3..d9849d0a7b 100644 --- a/backend/open_webui/routers/auths.py +++ b/backend/open_webui/routers/auths.py @@ -674,7 +674,7 @@ async def signout(request: Request, response: Response): oauth_id_token = request.cookies.get("oauth_id_token") if oauth_id_token: try: - async with ClientSession() as session: + async with ClientSession(trust_env=True) as session: async with session.get(OPENID_PROVIDER_URL.value) as resp: if resp.status == 200: openid_data = await resp.json() diff --git a/backend/open_webui/routers/functions.py b/backend/open_webui/routers/functions.py index 355093335a..96d8215fb3 100644 --- a/backend/open_webui/routers/functions.py +++ b/backend/open_webui/routers/functions.py @@ -105,7 +105,7 @@ async def load_function_from_url( ) try: - async with aiohttp.ClientSession() as session: + async with aiohttp.ClientSession(trust_env=True) as session: async with session.get( url, headers={"Content-Type": "application/json"} ) as resp: diff --git a/backend/open_webui/routers/tools.py b/backend/open_webui/routers/tools.py index f726368eba..41415bff04 100644 --- a/backend/open_webui/routers/tools.py +++ b/backend/open_webui/routers/tools.py @@ -153,7 +153,7 @@ async def load_tool_from_url( ) try: - async with aiohttp.ClientSession() as session: + async with aiohttp.ClientSession(trust_env=True) as session: async with session.get( url, headers={"Content-Type": "application/json"} ) as resp: