forked from AkkomaGang/akkoma
utils: fix another possible leak with private S3 backends using mediaproxy
same rationale as the other mediaproxy changes
This commit is contained in:
parent
fbbc5fc919
commit
784b3a615d
1 changed files with 2 additions and 0 deletions
|
@ -2,6 +2,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do
|
||||||
alias Pleroma.{Repo, Object, Formatter, Activity}
|
alias Pleroma.{Repo, Object, Formatter, Activity}
|
||||||
alias Pleroma.Web.ActivityPub.Utils
|
alias Pleroma.Web.ActivityPub.Utils
|
||||||
alias Pleroma.Web.Endpoint
|
alias Pleroma.Web.Endpoint
|
||||||
|
alias Pleroma.Web.MediaProxy
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
alias Calendar.Strftime
|
alias Calendar.Strftime
|
||||||
alias Comeonin.Pbkdf2
|
alias Comeonin.Pbkdf2
|
||||||
|
@ -90,6 +91,7 @@ def add_attachments(text, attachments) do
|
||||||
Enum.map(attachments, fn
|
Enum.map(attachments, fn
|
||||||
%{"url" => [%{"href" => href} | _]} ->
|
%{"url" => [%{"href" => href} | _]} ->
|
||||||
name = URI.decode(Path.basename(href))
|
name = URI.decode(Path.basename(href))
|
||||||
|
href = MediaProxy.url(href)
|
||||||
"<a href=\"#{href}\" class='attachment'>#{shortname(name)}</a>"
|
"<a href=\"#{href}\" class='attachment'>#{shortname(name)}</a>"
|
||||||
|
|
||||||
_ ->
|
_ ->
|
||||||
|
|
Loading…
Reference in a new issue