aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSachin Joshi <satchin.joshi@gmail.com>2019-07-12 21:02:55 +0545
committerAriadne Conill <ariadne@dereferenced.org>2019-07-28 22:37:18 +0000
commit1e5d889aec517cb1d66b1905f2cf04adada5d108 (patch)
tree2ac821a8e8dc489645cfffe58e9fd819cfca17ad /test
parentccafecf9be46bc11e3080d531146d05e18f493d4 (diff)
downloadpleroma-1e5d889aec517cb1d66b1905f2cf04adada5d108.tar.gz
preserve the original path/filename (no encoding/decoding) for proxy
Diffstat (limited to 'test')
-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 9c363dea8..69e9bc9f4 100644
--- a/test/media_proxy_test.exs
+++ b/test/media_proxy_test.exs
@@ -96,10 +96,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
@@ -108,19 +108,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