aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSachin Joshi <satchin.joshi@gmail.com>2019-07-12 22:19:30 +0545
committerSachin Joshi <satchin.joshi@gmail.com>2019-07-12 22:56:14 +0545
commitf8e3ae61545de45ce4dd395471149ed1e71e0343 (patch)
treebbd6205bfe1bf3ed84c4a1f06a13707245cd980a /test
parentb6567c9f4e290ba8ad928c9ed10e72d2589dd89a (diff)
downloadpleroma-f8e3ae61545de45ce4dd395471149ed1e71e0343.tar.gz
try to always match the filename for proxy url
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 fbf200931..176b09914 100644
--- a/test/media_proxy_test.exs
+++ b/test/media_proxy_test.exs
@@ -108,6 +108,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])