From 12528edc349a6ec10b1a1d9a7daf461823fdf928 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 12 Jan 2021 16:32:52 -0600 Subject: [PATCH] Fix another ad-hoc construction of the upload base_url --- lib/pleroma/upload.ex | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/pleroma/upload.ex b/lib/pleroma/upload.ex index 51ca97f41..619a85e93 100644 --- a/lib/pleroma/upload.ex +++ b/lib/pleroma/upload.ex @@ -131,12 +131,7 @@ defmodule Pleroma.Upload do uploader: Keyword.get(opts, :uploader, Pleroma.Config.get([__MODULE__, :uploader])), filters: Keyword.get(opts, :filters, Pleroma.Config.get([__MODULE__, :filters])), description: Keyword.get(opts, :description), - base_url: - Keyword.get( - opts, - :base_url, - Pleroma.Config.get([__MODULE__, :base_url], Pleroma.Web.base_url()) - ) + base_url: base_url() } end @@ -217,14 +212,7 @@ defmodule Pleroma.Upload do "" end - prefix = - if is_nil(Pleroma.Config.get([__MODULE__, :base_url])) do - "media" - else - "" - end - - [base_url, prefix, path] + [base_url, path] |> Path.join() end -- 2.45.2