diff options
author | lain <lain@soykaf.club> | 2018-12-01 09:55:46 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-12-01 09:55:46 +0100 |
commit | c443c9bd72b04b8a24d904bc20fde0d4ffca71d7 (patch) | |
tree | 1044379e9e6867ded303f81a6ca49da83e01cfd2 /test/media_proxy_test.exs | |
parent | 1c67277c8031be2212d6faf84c143ac11462c87b (diff) | |
parent | 8c3ff06e35e11a40cf4eb35a41a2019b7496e62c (diff) | |
download | pleroma-c443c9bd72b04b8a24d904bc20fde0d4ffca71d7.tar.gz pleroma-c443c9bd72b04b8a24d904bc20fde0d4ffca71d7.zip |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into validate-user-info
Diffstat (limited to 'test/media_proxy_test.exs')
-rw-r--r-- | test/media_proxy_test.exs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/media_proxy_test.exs b/test/media_proxy_test.exs index c69ed7ea4..d71f9f13a 100644 --- a/test/media_proxy_test.exs +++ b/test/media_proxy_test.exs @@ -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 |