X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fmedia_proxy_test.exs;h=fbf2009310382a3f4cd70da33b0b5166006689a2;hb=f4c001062e51c207bf84f56473ddf6120e3b50fb;hp=1d6d170b72e02d4986ad087fb3a090c7cb59a391;hpb=1417627d07a29e06efec2b282405e72bcfb1269c;p=akkoma 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