diff options
author | feld <feld@feld.me> | 2019-07-15 22:04:58 +0000 |
---|---|---|
committer | feld <feld@feld.me> | 2019-07-15 22:04:58 +0000 |
commit | 9f987dd017f352d63c7441e2cce301aea07082a8 (patch) | |
tree | 116c60eb6154344e4df2c59cd2a4d8b023948490 /test | |
parent | 03bcb40883dafa2886110e2b625c4cc5c21106f1 (diff) | |
parent | 1d906ffa82633af21233c3030fbe2d127b5b77f9 (diff) | |
download | pleroma-9f987dd017f352d63c7441e2cce301aea07082a8.tar.gz pleroma-9f987dd017f352d63c7441e2cce301aea07082a8.zip |
Merge branch 'match-file-name' into 'develop'
try to always match the filename for proxy url
See merge request pleroma/pleroma!1405
Diffstat (limited to 'test')
-rw-r--r-- | test/web/media_proxy/media_proxy_test.exs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/web/media_proxy/media_proxy_test.exs b/test/web/media_proxy/media_proxy_test.exs index cb4807e0b..edbbf9b66 100644 --- a/test/web/media_proxy/media_proxy_test.exs +++ b/test/web/media_proxy/media_proxy_test.exs @@ -114,6 +114,17 @@ defmodule Pleroma.Web.MediaProxyTest do ) == {:wrong_filename, "my%2Flong%2Furl%2F2019%2F07%2FS.jpg"} end + test "encoded url are tried to match for proxy as `conn.request_path` encodes the url" do + # conn.request_path will return encoded url + request_path = "/ANALYSE-DAI-_-LE-STABLECOIN-100-D%C3%89CENTRALIS%C3%89-BQ.jpg" + + assert MediaProxyController.filename_matches( + true, + request_path, + "https://mydomain.com/uploads/2019/07/ANALYSE-DAI-_-LE-STABLECOIN-100-DÉCENTRALISÉ-BQ.jpg" + ) == :ok + end + test "uses the configured base_url" do base_url = Pleroma.Config.get([:media_proxy, :base_url]) |