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.pyindex 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 cacheext = cache.get(key)+ ext = ext.decode("utf-8") if ext else Noneif not ext:# If the extension is still not present, try getting it from the content type