From 1a0eca4a3831f0498f6c1fb14c032aeb3afea65b Mon Sep 17 00:00:00 2001 From: suyiiyii Date: Thu, 24 Oct 2024 16:56:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:sparkles:=20=E6=9B=B4=E6=96=B0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4UA=E4=B8=BAWindows=E5=B9=B3=E5=8F=B0=20(#643)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker.env.prod | 2 +- nonebot_bison/plugin_config.py | 3 ++- tests/test_context.py | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docker.env.prod b/docker.env.prod index 29cf43e..68e1cba 100644 --- a/docker.env.prod +++ b/docker.env.prod @@ -22,7 +22,7 @@ BISON_SKIP_BROWSER_CHECK=false BISON_USE_PIC_MERGE=0 BISON_RESEND_TIMES=0 BISON_PROXY= -BISON_UA=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36 +BISON_UA=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0 BISON_SHOW_NETWORK_WARNING=true BISON_PLATFORM_THEME='{}' diff --git a/nonebot_bison/plugin_config.py b/nonebot_bison/plugin_config.py index ca2aa60..b7f7307 100644 --- a/nonebot_bison/plugin_config.py +++ b/nonebot_bison/plugin_config.py @@ -36,7 +36,8 @@ class PlugConfig(BaseModel): bison_resend_times: int = 0 bison_proxy: str | None = None bison_ua: str = Field( - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)" + " Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0", description="默认UA", ) bison_show_network_warning: bool = True diff --git a/tests/test_context.py b/tests/test_context.py index 220f62c..b277def 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -17,7 +17,8 @@ async def test_http_error(app: App): assert ctx.gen_req_records() == [ "https://example.com Headers({'host': 'example.com', 'accept': '*/*', 'accept-encoding': 'gzip, deflate'," - " 'connection': 'keep-alive', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like" - " Gecko) Chrome/51.0.2704.103 Safari/537.36'}) | [403] Headers({'content-length': '15', 'content-type':" + " 'connection': 'keep-alive', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" + " (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0'}) | [403] Headers({'content-length': '" + "15', 'content-type':" ' \'application/json\'}) {"error": "gg"}' ] From 08ba7b0e3b39ea9a11373e97c514a9dcc33ec029 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 24 Oct 2024 08:56:51 +0000 Subject: [PATCH 2/2] :memo: Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd4a759..e2fac35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 最近更新 +### 新功能 + +- :sparkles: 更新默认UA为Windows平台 [@suyiiyii](https://github.com/suyiiyii) ([#643](https://github.com/MountainDash/nonebot-bison/pull/643)) + ### 文档 - 📝 小刻食堂剪彩文档 [@phidiaLam](https://github.com/phidiaLam) ([#636](https://github.com/MountainDash/nonebot-bison/pull/636))