aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/media_proxy_test.exs11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/media_proxy_test.exs b/test/media_proxy_test.exs
index b23aeb88b..9c363dea8 100644
--- a/test/media_proxy_test.exs
+++ b/test/media_proxy_test.exs
@@ -124,6 +124,17 @@ defmodule Pleroma.MediaProxyTest do
) == :ok
end
+ test "encoded url are tried to match for proxy as `conn.request_path` encodes the url" do
+ # conn.request_path will return encoded url
+ request_path = "/ANALYSE-DAI-_-LE-STABLECOIN-100-D%C3%89CENTRALIS%C3%89-BQ.jpg"
+
+ assert MediaProxyController.filename_matches(
+ true,
+ request_path,
+ "https://mydomain.com/uploads/2019/07/ANALYSE-DAI-_-LE-STABLECOIN-100-DÉCENTRALISÉ-BQ.jpg"
+ ) == :ok
+ end
+
test "uses the configured base_url" do
base_url = Pleroma.Config.get([:media_proxy, :base_url])