Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Decode cached file type for thumbnails (#2163)

Krystle Salazar08837a8b39b0
diff --git a/api/api/utils/photon.py b/api/api/utils/photon.py
index 79416eac1..bb5cfb4c4 100644
--- a/api/api/utils/photon.py
+++ b/api/api/utils/photon.py
@@ -56,6 +56,7 @@ def check_image_type(image_url: str, media_obj) -> None:
if not ext:
# If the extension is not present in the URL, try to get it from the redis cache
ext = cache.get(key)
+ ext = ext.decode("utf-8") if ext else None
if not ext:
# If the extension is still not present, try getting it from the content type