Skip to content

Commit

Permalink
fix(aiohttp): Prevent double access of .json
Browse files Browse the repository at this point in the history
Previously both the `request` and `search` methods called `await r.json()`, leading to the `search` method calling `.json()` on a dictionary. This caused the following error: `'dict' object has no attribute 'json'`
  • Loading branch information
Minion3665 authored Sep 17, 2024
1 parent fc0243e commit 002dfbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion google_custom_search/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ async def search(self, *args, **kwargs) -> List[Item]:
r = await self.request(
"GET", "/", params=self._payload_maker(*args, **kwargs)
)
return self._from_dict(await r.json())
return self._from_dict(r)

0 comments on commit 002dfbc

Please sign in to comment.