commit: 18835bf7012e8e234eb27456a437f4d1e8796645
parent f8ce639e3f76257097793c666d3ebf8f22539a30
Author: Mark Felder <feld@feld.me>
Date: Tue, 28 May 2024 09:38:36 -0400
Use the configured http client options for mediaproxy
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/pleroma/helpers/media_helper.ex b/lib/pleroma/helpers/media_helper.ex
@@ -25,7 +25,7 @@ defmodule Pleroma.Helpers.MediaHelper do
end
def image_resize(url, options) do
- with {:ok, env} <- HTTP.get(url, [], pool: :media),
+ with {:ok, env} <- HTTP.get(url, [], http_client_opts()),
{:ok, resized} <-
Operation.thumbnail_buffer(env.body, options.max_width,
height: options.max_height,
@@ -46,7 +46,7 @@ defmodule Pleroma.Helpers.MediaHelper do
def video_framegrab(url) do
with executable when is_binary(executable) <- System.find_executable("ffmpeg"),
false <- @cachex.exists?(:failed_media_helper_cache, url),
- {:ok, env} <- HTTP.get(url, [], pool: :media),
+ {:ok, env} <- HTTP.get(url, [], http_client_opts()),
{:ok, pid} <- StringIO.open(env.body) do
body_stream = IO.binstream(pid, 1)
@@ -84,4 +84,6 @@ defmodule Pleroma.Helpers.MediaHelper do
{:error, _} = error -> error
end
end
+
+ defp http_client_opts, do: Pleroma.Config.get([:media_proxy, :proxy_opts, :http], pool: :media)
end