commit: 157ecf402230c0b786f5765dd8b709d45c45974a
parent 697bea04731614bcd2e1e10f0564863dc49a49fa
Author: Mark Felder <feld@FreeBSD.org>
Date: Thu, 27 Aug 2020 11:46:56 -0500
Follow redirects.
I think we should be using some global adapter options here, though.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/pleroma/web/media_proxy/media_proxy_controller.ex b/lib/pleroma/web/media_proxy/media_proxy_controller.ex
@@ -50,7 +50,9 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyController do
defp handle_preview(conn, url) do
with {:ok, %{status: status} = head_response} when status in 200..299 <-
- Tesla.head(url, opts: [adapter: [timeout: preview_head_request_timeout()]]) do
+ Tesla.head(url,
+ opts: [adapter: [timeout: preview_head_request_timeout(), follow_redirect: true]]
+ ) do
content_type = Tesla.get_header(head_response, "content-type")
handle_preview(content_type, conn, url)
else