Upload: bring back base_url
This commit is contained in:
parent
5d92431350
commit
65e7307d68
3 changed files with 46 additions and 4 deletions
|
|
@ -82,6 +82,23 @@ defmodule Pleroma.MediaProxyTest do
|
|||
[_, "proxy", sig, base64 | _] = URI.parse(encoded).path |> String.split("/")
|
||||
assert decode_url(sig, base64) == {:error, :invalid_signature}
|
||||
end
|
||||
|
||||
test "uses the configured base_url" do
|
||||
base_url = Pleroma.Config.get([:media_proxy, :base_url])
|
||||
|
||||
if base_url do
|
||||
on_exit(fn ->
|
||||
Pleroma.Config.put([:media_proxy, :base_url], base_url)
|
||||
end)
|
||||
end
|
||||
|
||||
Pleroma.Config.put([:media_proxy, :base_url], "https://cache.pleroma.social")
|
||||
|
||||
url = "https://pleroma.soykaf.com/static/logo.png"
|
||||
encoded = url(url)
|
||||
|
||||
assert String.starts_with?(encoded, Pleroma.Config.get([:media_proxy, :base_url]))
|
||||
end
|
||||
end
|
||||
|
||||
describe "when disabled" do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue