preserve the original path/filename (no encoding/decoding) for proxy

This commit is contained in:
Sachin Joshi 2019-07-12 21:02:55 +05:45
commit 6a6c4d134b
2 changed files with 5 additions and 18 deletions

View file

@ -28,12 +28,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyController do
end
def filename_matches(has_filename, path, url) do
filename =
url
|> MediaProxy.filename()
|> URI.decode()
path = URI.decode(path)
filename = url |> MediaProxy.filename()
if has_filename && filename && Path.basename(path) != filename do
{:wrong_filename, filename}