From 5fb89137048c0a804153cf008cfbd41bdfa61c27 Mon Sep 17 00:00:00 2001 From: helloplhm-qwq Date: Sat, 13 Jan 2024 01:09:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8Daioh?= =?UTF-8?q?ttp=E8=AF=B7=E6=B1=82=E6=97=B6=E7=9A=84=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=20#21?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/Httpx.py | 2 +- main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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停止")