Skip to content

Commit

Permalink
follow redirects in fetch_content
Browse files Browse the repository at this point in the history
  • Loading branch information
eudoxos committed Mar 12, 2024
1 parent 02947c5 commit c539613
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 c539613

Please sign in to comment.