Skip to content

Commit

Permalink
Refactor SoupPage's post method to return JSON response if content ty…
Browse files Browse the repository at this point in the history
…pe is application/json
  • Loading branch information
mohamedmamdouh22 committed Jan 23, 2025
1 parent 714ef22 commit 207cbe6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/harambe/contrib/soup/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async def post(
self._url = res.url
content_type = res.headers.get("Content-Type", "")
if "application/json" in content_type:
return SoupResponseWithStatus(res.status_code, res.text)
return SoupResponseWithStatus(res.status_code, res.json())

self._soup = BeautifulSoup(res.text, "html.parser")

Expand Down

0 comments on commit 207cbe6

Please sign in to comment.