From 16efef376e046de4a82e502f8d2a16f0b6734397 Mon Sep 17 00:00:00 2001 From: Denn0 Date: Tue, 18 Aug 2020 16:33:20 +0200 Subject: [PATCH] Add proxy support Needed proxy support, also for authentication step. Added environment proxy setting support as described here: https://docs.aiohttp.org/en/stable/client_advanced.html?highlight=proxy#proxy-support --- aiosfstream/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aiosfstream/auth.py b/aiosfstream/auth.py index 726d0bf..54e9cc3 100644 --- a/aiosfstream/auth.py +++ b/aiosfstream/auth.py @@ -162,7 +162,7 @@ def __repr__(self) -> str: f"password={reprlib.repr(self.password)})" async def _authenticate(self) -> Tuple[int, JsonObject]: - async with ClientSession(json_serialize=self.json_dumps) as session: + async with ClientSession(json_serialize=self.json_dumps,trust_env=True) as session: data = { "grant_type": "password", "client_id": self.client_id, @@ -214,7 +214,7 @@ def __repr__(self) -> str: f"refresh_token={reprlib.repr(self.refresh_token)})" async def _authenticate(self) -> Tuple[int, JsonObject]: - async with ClientSession(json_serialize=self.json_dumps) as session: + async with ClientSession(json_serialize=self.json_dumps,trust_env=True) as session: data = { "grant_type": "refresh_token", "client_id": self.client_id,