mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-22 22:49:25 +00:00
Add simple way to decode fully qualified mediaproxy URLs
This commit is contained in:
parent
13aa98d689
commit
e97b34f65d
|
@ -121,6 +121,11 @@ defmodule Pleroma.Web.MediaProxy do
|
|||
end
|
||||
end
|
||||
|
||||
def decode_url(encoded) do
|
||||
[_, "proxy", sig, base64 | _] = URI.parse(encoded).path |> String.split("/")
|
||||
decode_url(sig, base64)
|
||||
end
|
||||
|
||||
defp signed_url(url) do
|
||||
:crypto.hmac(:sha, Config.get([Web.Endpoint, :secret_key_base]), url)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue