make sure the url used by proxy is same as origin url

encoding or decoding it breaks some of the signed url
This commit is contained in:
Sachin Joshi 2019-07-07 14:13:40 +05:45
commit f5ad430974
2 changed files with 6 additions and 24 deletions

View file

@ -70,9 +70,12 @@ defmodule Pleroma.MediaProxyTest do
assert decode_result(encoded) == url
end
test "ensures urls are url-encoded" do
# Some of the signed url expect the special character in the url to be same
# for the proxy to work.
# Issue https://git.pleroma.social/pleroma/pleroma/issues/1055
test "ensures urls are maintained (character are not encoded or decoded)" do
assert decode_result(url("https://pleroma.social/Hello world.jpg")) ==
"https://pleroma.social/Hello%20world.jpg"
"https://pleroma.social/Hello world.jpg"
assert decode_result(url("https://pleroma.social/Hello%20world.jpg")) ==
"https://pleroma.social/Hello%20world.jpg"