From: Mark Felder Date: Tue, 25 Aug 2020 22:31:55 +0000 (-0500) Subject: Redirects for videos right now X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=ddbddc08fc9fe5458edc983c81a77671da34a71f;p=akkoma Redirects for videos right now --- diff --git a/lib/pleroma/web/media_proxy/media_proxy_controller.ex b/lib/pleroma/web/media_proxy/media_proxy_controller.ex index b925973ba..6abbf9e23 100644 --- a/lib/pleroma/web/media_proxy/media_proxy_controller.ex +++ b/lib/pleroma/web/media_proxy/media_proxy_controller.ex @@ -69,6 +69,12 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyController do handle_image_preview(conn, url) end + defp handle_preview("video/" <> _ = _content_type, conn, url) do + mediaproxy_url = url |> MediaProxy.url() + + redirect(conn, external: mediaproxy_url) + end + defp handle_preview(content_type, conn, _url) do send_resp(conn, :unprocessable_entity, "Unsupported content type: #{content_type}.") end