diff --git a/common/Httpx.py b/common/Httpx.py index 1511e29..005edc3 100644 --- a/common/Httpx.py +++ b/common/Httpx.py @@ -229,7 +229,7 @@ async def AsyncRequest(url, options = {}): @ return: common.Httpx.ClientResponse类型的响应数据 ''' if (not variable.aioSession): - variable.aioSession = aiohttp.ClientSession() + variable.aioSession = aiohttp.ClientSession(trust_env=True) # 缓存读取 cache_key = f'{url}{options}' if (isinstance(options.get('cache-ignore'), list)): diff --git a/main.py b/main.py index e7a8fc9..7a05571 100644 --- a/main.py +++ b/main.py @@ -208,7 +208,7 @@ async def run_app(): async def initMain(): await scheduler.run() - variable.aioSession = aiohttp.ClientSession() + variable.aioSession = aiohttp.ClientSession(trust_env=True) try: await run_app() logger.info("服务器启动成功,请按下Ctrl + C停止")