mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-11 03:39:13 +00:00
Follow redirects.
I think we should be using some global adapter options here, though.
This commit is contained in:
parent
697bea0473
commit
157ecf4022
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue