From: Mark Felder Date: Wed, 26 Aug 2020 21:18:11 +0000 (-0500) Subject: Ensure GIFs are redirected to the original or they become static. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=eead2276e79f29c4d0e10d23eb7524a9ee5f5045;p=akkoma Ensure GIFs are redirected to the original or they become static. --- diff --git a/lib/pleroma/web/media_proxy/media_proxy_controller.ex b/lib/pleroma/web/media_proxy/media_proxy_controller.ex index 6abbf9e23..d465ce8d1 100644 --- a/lib/pleroma/web/media_proxy/media_proxy_controller.ex +++ b/lib/pleroma/web/media_proxy/media_proxy_controller.ex @@ -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