mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
apply proxy settings to media_proxy
This commit is contained in:
parent
39854d6c11
commit
1e185b9301
1 changed files with 3 additions and 1 deletions
|
@ -2,6 +2,8 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyController do
|
|||
use Pleroma.Web, :controller
|
||||
require Logger
|
||||
|
||||
@httpoison Application.get_env(:pleroma, :httpoison)
|
||||
|
||||
@max_body_length 25 * 1048576
|
||||
|
||||
@cache_control %{
|
||||
|
@ -29,7 +31,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyController do
|
|||
|
||||
defp proxy_request(link) do
|
||||
headers = [{"user-agent", "Pleroma/MediaProxy; #{Pleroma.Web.base_url()} <#{Application.get_env(:pleroma, :instance)[:email]}>"}]
|
||||
options = [:insecure, {:follow_redirect, true}]
|
||||
options = @httpoison.process_request_options([:insecure, {:follow_redirect, true}])
|
||||
with \
|
||||
{:ok, 200, headers, client} <- :hackney.request(:get, link, headers, "", options),
|
||||
headers = Enum.into(headers, Map.new),
|
||||
|
|
Loading…
Reference in a new issue