diff options
author | Sachin Joshi <satchin.joshi@gmail.com> | 2019-07-12 21:02:55 +0545 |
---|---|---|
committer | Sachin Joshi <satchin.joshi@gmail.com> | 2019-07-12 21:05:01 +0545 |
commit | 6a6c4d134b7564012d00e89f1236b904261ab5db (patch) | |
tree | 25654a6dc259afb81a746926a44366ee5d6c7b2b /test | |
parent | db75288b71e7531f8e5033f56fc0b9a7d1d8efb3 (diff) | |
download | pleroma-6a6c4d134b7564012d00e89f1236b904261ab5db.tar.gz pleroma-6a6c4d134b7564012d00e89f1236b904261ab5db.zip |
preserve the original path/filename (no encoding/decoding) for proxy
Diffstat (limited to 'test')
-rw-r--r-- | test/media_proxy_test.exs | 16 |
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 |