mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 10:09:02 +00:00
media_proxy: use path only to retrieve filename
This commit is contained in:
parent
9b553a1087
commit
f52a1d1ec5
|
@ -30,7 +30,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyController do
|
|||
|
||||
with true <- Keyword.get(config, :enabled, false),
|
||||
{:ok, url} <- Pleroma.Web.MediaProxy.decode_url(sig, url),
|
||||
filename <- Path.basename(url),
|
||||
filename <- Path.basename(URI.parse(url).path),
|
||||
true <-
|
||||
if(Map.get(params, "filename"),
|
||||
do: filename == Path.basename(conn.request_path),
|
||||
|
|
|
@ -15,7 +15,7 @@ defmodule Pleroma.Web.MediaProxy do
|
|||
base64 = Base.url_encode64(url, @base64_opts)
|
||||
sig = :crypto.hmac(:sha, secret, base64)
|
||||
sig64 = sig |> Base.url_encode64(@base64_opts)
|
||||
filename = Path.basename(url)
|
||||
filename = Path.basename(URI.parse(url).path)
|
||||
|
||||
Keyword.get(config, :base_url, Pleroma.Web.base_url()) <>
|
||||
"/proxy/#{sig64}/#{base64}/#{filename}"
|
||||
|
|
Loading…
Reference in a new issue