diff --git a/viking_file/api.py b/viking_file/api.py index 60680d3..b9355b4 100644 --- a/viking_file/api.py +++ b/viking_file/api.py @@ -10,7 +10,7 @@ BASE_URL = "https://vikingfile.com/api/" @asynccontextmanager async def _get_session(session: ClientSession | None) -> AsyncGenerator[ClientSession, None]: close_session = session is None - session = session or ClientSession() + session = session or ClientSession(trust_env=True) try: yield session finally: diff --git a/viking_file/clients/client.py b/viking_file/clients/client.py index 1426a26..f1c59ed 100644 --- a/viking_file/clients/client.py +++ b/viking_file/clients/client.py @@ -10,7 +10,7 @@ from viking_file.clients.client_async import AsyncVikingClient class VikingClient(AsyncVikingClient): def __init__(self, user_hash: str = "", api_timeout: int = 10): self._loop = asyncio.new_event_loop() - session = ClientSession(loop=self._loop) + session = ClientSession(loop=self._loop, trust_env=True) super().__init__(user_hash, api_timeout, session) def __enter__(self): diff --git a/viking_file/clients/client_async.py b/viking_file/clients/client_async.py index 588d01e..b7a85ad 100644 --- a/viking_file/clients/client_async.py +++ b/viking_file/clients/client_async.py @@ -33,7 +33,7 @@ class AsyncVikingClient: self.hash = user_hash self.timeout = api_timeout self._close_session = _session is None - self._session = _session or ClientSession() + self._session = _session or ClientSession(trust_env=True) atexit.register(self._cleanup)