From 1e185b9301ec85cd2aaeb1faf075aaa86f733373 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sun, 31 Dec 2017 09:25:00 -0500 Subject: [PATCH] apply proxy settings to media_proxy --- lib/pleroma/web/media_proxy/controller.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/media_proxy/controller.ex b/lib/pleroma/web/media_proxy/controller.ex index 560a65353..9327e7253 100644 --- a/lib/pleroma/web/media_proxy/controller.ex +++ b/lib/pleroma/web/media_proxy/controller.ex @@ -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 @@ def remote(conn, %{"sig" => sig, "url" => url}) 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),