From fdc0f5de347eebd8bf09f4835267002efc74c552 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Sun, 1 Dec 2024 06:59:27 +0000 Subject: [PATCH] :bug: fix httpx request params missing --- nonebot/drivers/aiohttp.py | 4 +--- nonebot/drivers/httpx.py | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nonebot/drivers/aiohttp.py b/nonebot/drivers/aiohttp.py index 154034c42db7..d651517a1855 100644 --- a/nonebot/drivers/aiohttp.py +++ b/nonebot/drivers/aiohttp.py @@ -90,9 +90,7 @@ def client(self) -> aiohttp.ClientSession: @override async def request(self, setup: Request) -> Response: if self._params: - params = self._params.copy() - params.update(setup.url.query) - url = setup.url.with_query(params) + url = setup.url.with_query({**self._params, **setup.url.query}) else: url = setup.url diff --git a/nonebot/drivers/httpx.py b/nonebot/drivers/httpx.py index 09efc6bdc850..c6c015af7255 100644 --- a/nonebot/drivers/httpx.py +++ b/nonebot/drivers/httpx.py @@ -82,6 +82,8 @@ async def request(self, setup: Request) -> Response: data=setup.data, files=setup.files, json=setup.json, + # ensure the params priority + params=setup.url.raw_query_string, headers=tuple(setup.headers.items()), cookies=setup.cookies.jar, timeout=setup.timeout,