summaryrefslogtreecommitdiff
path: root/test/media_proxy_test.exs
diff options
context:
space:
mode:
authorMaxim Filippov <colixer@gmail.com>2019-07-14 00:39:06 +0300
committerMaxim Filippov <colixer@gmail.com>2019-07-14 00:39:06 +0300
commit418ae6638d64c915ce4dae742dd493f43c8025d8 (patch)
tree88dab25ac8f569c2a7c12300be79f6cbd8357afe /test/media_proxy_test.exs
parenta9459ff98f0af590931ef279c2bc7efb0cceac5a (diff)
parent592411e4fe8a1cf39064e3dd5f9312ed5cdcd22e (diff)
downloadpleroma-418ae6638d64c915ce4dae742dd493f43c8025d8.tar.gz
pleroma-418ae6638d64c915ce4dae742dd493f43c8025d8.zip
Merge branch 'develop' into feature/admin-api-user-statuses
Diffstat (limited to 'test/media_proxy_test.exs')
-rw-r--r--test/media_proxy_test.exs16
1 files changed, 4 insertions, 12 deletions
diff --git a/test/media_proxy_test.exs b/test/media_proxy_test.exs
index 1d6d170b7..fbf200931 100644
--- a/test/media_proxy_test.exs
+++ b/test/media_proxy_test.exs
@@ -88,10 +88,10 @@ defmodule Pleroma.MediaProxyTest do
assert decode_url(sig, base64) == {:error, :invalid_signature}
end
- test "filename_matches matches url encoded paths" do
+ test "filename_matches preserves the encoded or decoded path" do
assert MediaProxyController.filename_matches(
true,
- "/Hello%20world.jpg",
+ "/Hello world.jpg",
"http://pleroma.social/Hello world.jpg"
) == :ok
@@ -100,19 +100,11 @@ defmodule Pleroma.MediaProxyTest do
"/Hello%20world.jpg",
"http://pleroma.social/Hello%20world.jpg"
) == :ok
- end
- test "filename_matches matches non-url encoded paths" do
assert MediaProxyController.filename_matches(
true,
- "/Hello world.jpg",
- "http://pleroma.social/Hello%20world.jpg"
- ) == :ok
-
- assert MediaProxyController.filename_matches(
- true,
- "/Hello world.jpg",
- "http://pleroma.social/Hello world.jpg"
+ "/my%2Flong%2Furl%2F2019%2F07%2FS.jpg",
+ "http://pleroma.social/my%2Flong%2Furl%2F2019%2F07%2FS.jpg"
) == :ok
end