aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/common_api/utils.ex
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2018-10-29 18:07:47 +0000
committerkaniini <nenolod@gmail.com>2018-10-29 18:07:47 +0000
commit7ac701ccd211d0a1b04243e4c0591adb9f1996fc (patch)
tree4785078ba8a5a7b6826508d03aaf620d792fe46b /lib/pleroma/web/common_api/utils.ex
parentf61acdc5b41a8d05401c5d24d589f35ba1b573de (diff)
parent36825932eb04d9db3e2d24b02368d7dd709dea23 (diff)
downloadpleroma-7ac701ccd211d0a1b04243e4c0591adb9f1996fc.tar.gz
Merge branch 'feature/s3-force-media-proxy' into 'develop'
s3 uploader: force public URIs through media proxy See merge request pleroma/pleroma!403
Diffstat (limited to 'lib/pleroma/web/common_api/utils.ex')
-rw-r--r--lib/pleroma/web/common_api/utils.ex4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex
index ed1fe1ad9..2a5a2cc15 100644
--- a/lib/pleroma/web/common_api/utils.ex
+++ b/lib/pleroma/web/common_api/utils.ex
@@ -89,8 +89,8 @@ defmodule Pleroma.Web.CommonAPI.Utils do
def add_attachments(text, attachments) do
attachment_text =
Enum.map(attachments, fn
- %{"url" => [%{"href" => href} | _]} ->
- name = URI.decode(Path.basename(href))
+ %{"url" => [%{"href" => href} | _]} = attachment ->
+ name = attachment["name"] || URI.decode(Path.basename(href))
href = MediaProxy.url(href)
"<a href=\"#{href}\" class='attachment'>#{shortname(name)}</a>"