Ensure GIFs are redirected to the original or they become static.
authorMark Felder <feld@FreeBSD.org>
Wed, 26 Aug 2020 21:18:11 +0000 (16:18 -0500)
committerMark Felder <feld@FreeBSD.org>
Wed, 26 Aug 2020 21:18:11 +0000 (16:18 -0500)
lib/pleroma/web/media_proxy/media_proxy_controller.ex

index 6abbf9e238007dee46ac46eb90eff06923910ca4..d465ce8d10e530b036bbf789e986ffdc3bf7bcab 100644 (file)
@@ -65,6 +65,12 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyController do
     end
   end
 
+  defp handle_preview("image/gif" = _content_type, conn, url) do
+    mediaproxy_url = url |> MediaProxy.url()
+
+    redirect(conn, external: mediaproxy_url)
+  end
+
   defp handle_preview("image/" <> _ = _content_type, conn, url) do
     handle_image_preview(conn, url)
   end