Skip to content

Commit

Permalink
🐛 fix httpx request params missing
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu authored Dec 1, 2024
1 parent 15ef9e4 commit fdc0f5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions nonebot/drivers/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions nonebot/drivers/httpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fdc0f5d

Please sign in to comment.