From 43d5e4f7fa4cfe9da8b3969847a1132e62a9e68b Mon Sep 17 00:00:00 2001 From: href Date: Sun, 2 Dec 2018 11:24:02 +0100 Subject: [PATCH] Fix media proxy config defaults --- lib/pleroma/web/media_proxy/controller.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/web/media_proxy/controller.ex b/lib/pleroma/web/media_proxy/controller.ex index 81ea5d510..e1b87e026 100644 --- a/lib/pleroma/web/media_proxy/controller.ex +++ b/lib/pleroma/web/media_proxy/controller.ex @@ -5,12 +5,12 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyController do @default_proxy_opts [max_body_length: 25 * 1_048_576] def remote(conn, params = %{"sig" => sig64, "url" => url64}) do - with config <- Pleroma.Config.get([:media_proxy]), + with config <- Pleroma.Config.get([:media_proxy], []), true <- Keyword.get(config, :enabled, false), {:ok, url} <- MediaProxy.decode_url(sig64, url64), filename <- Path.basename(URI.parse(url).path), :ok <- filename_matches(Map.has_key?(params, "filename"), conn.request_path, url) do - ReverseProxy.call(conn, url, Keyword.get(config, :proxy_opts, @default_proxy_length)) + ReverseProxy.call(conn, url, Keyword.get(config, :proxy_opts, @default_proxy_opts)) else false -> send_resp(conn, 404, Plug.Conn.Status.reason_phrase(404)) -- 2.45.2