From c539613f4a99ab7940660c16ffe823ae8e0a6792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20=C5=A0milauer?= Date: Tue, 12 Mar 2024 17:27:18 +0700 Subject: [PATCH] follow redirects in fetch_content --- oembedpy/consumer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oembedpy/consumer.py b/oembedpy/consumer.py index 9f92969..bf881f3 100644 --- a/oembedpy/consumer.py +++ b/oembedpy/consumer.py @@ -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"):