projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
13aa98d
)
Add simple way to decode fully qualified mediaproxy URLs
author
Mark Felder
<feld@feld.me>
Fri, 5 Mar 2021 19:18:37 +0000
(13:18 -0600)
committer
Mark Felder
<feld@feld.me>
Fri, 5 Mar 2021 19:18:37 +0000
(13:18 -0600)
lib/pleroma/web/media_proxy.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/media_proxy.ex
b/lib/pleroma/web/media_proxy.ex
index 27f3371389edbb5178e5b6435f746b2d19c65be6..d0d4bb4b3d81a66cbbe02579faa1ba9f10f8fc2c 100644
(file)
--- a/
lib/pleroma/web/media_proxy.ex
+++ b/
lib/pleroma/web/media_proxy.ex
@@
-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