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,