Remove configurability of upload proxy opts, simplify
authorMark Felder <feld@feld.me>
Tue, 5 Jan 2021 21:06:00 +0000 (15:06 -0600)
committerMark Felder <feld@feld.me>
Tue, 5 Jan 2021 21:06:00 +0000 (15:06 -0600)
config/config.exs
lib/pleroma/web/plugs/uploaded_media.ex

index d6d116314e3f9a8a965e121b19af7b19bfaccefa..7b14fbfe5af3499139c68202d7f407adf9a9ac04 100644 (file)
@@ -63,14 +63,6 @@ config :pleroma, Pleroma.Upload,
   filters: [Pleroma.Upload.Filter.Dedupe],
   link_name: false,
   proxy_remote: false,
-  proxy_opts: [
-    redirect_on_failure: false,
-    max_body_length: 25 * 1_048_576,
-    http: [
-      follow_redirect: true,
-      pool: :upload
-    ]
-  ],
   filename_display_max_length: 30,
   default_description: nil
 
index 402a8bb34c3d4b71f2decde632902601227c7041..94b4c2177d9ae762c5d1491c3c611ce882df95f6 100644 (file)
@@ -87,8 +87,15 @@ defmodule Pleroma.Web.Plugs.UploadedMedia do
   end
 
   defp get_media(conn, {:url, url}, true, _) do
+    proxy_opts = [
+      http: [
+        follow_redirect: true,
+        pool: :upload
+      ]
+    ]
+
     conn
-    |> Pleroma.ReverseProxy.call(url, Pleroma.Config.get([Pleroma.Upload, :proxy_opts], []))
+    |> Pleroma.ReverseProxy.call(url, proxy_opts)
   end
 
   defp get_media(conn, {:url, url}, _, _) do