Skip to content

Commit

Permalink
Merge pull request #1 from eudoxos/redirect
Browse files Browse the repository at this point in the history
follow redirects in fetch_content
  • Loading branch information
attakei authored Apr 21, 2024
2 parents 0f9467d + c539613 commit 7eafee3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oembedpy/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def fetch_content(url: str, params: RequestParameters) -> types.Content:
* OK: ``text/xml``
* NG: ``text/plain`` (even if body is JSON string)
"""
resp = httpx.get(url, params=params.to_dict())
resp = httpx.get(url, params=params.to_dict(), follow_redirects=True)
resp.raise_for_status()
content_type = resp.headers.get("content-type", "").split(";")[0] # Exclude chaset
if content_type.endswith("/json"):
Expand Down

0 comments on commit 7eafee3

Please sign in to comment.