Do not prepend /media/ when using base_url

This ensures admin has full control over the path where media resides.
This commit is contained in:
feld 2019-07-24 15:35:25 +00:00 committed by kaniini
commit 84fca14c3c
2 changed files with 36 additions and 19 deletions

View file

@ -228,7 +228,14 @@ defmodule Pleroma.Upload do
""
end
[base_url, "media", path]
prefix =
if is_nil(Pleroma.Config.get([__MODULE__, :base_url])) do
"media"
else
""
end
[base_url, prefix, path]
|> Path.join()
end