Merge branch 'remote-url-fix' into 'develop'
Make `remote_url` link to unproxied URL See merge request pleroma/pleroma!4365
This commit is contained in:
commit
a893c69d20
2 changed files with 4 additions and 2 deletions
1
changelog.d/remote-url.fix
Normal file
1
changelog.d/remote-url.fix
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
`remote_url` links to unproxied URL
|
||||||
|
|
@ -602,7 +602,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
||||||
def render("attachment.json", %{attachment: attachment}) do
|
def render("attachment.json", %{attachment: attachment}) do
|
||||||
[attachment_url | _] = attachment["url"]
|
[attachment_url | _] = attachment["url"]
|
||||||
media_type = attachment_url["mediaType"] || attachment_url["mimeType"] || "image"
|
media_type = attachment_url["mediaType"] || attachment_url["mimeType"] || "image"
|
||||||
href = attachment_url["href"] |> MediaProxy.url()
|
href_remote = attachment_url["href"]
|
||||||
|
href = href_remote |> MediaProxy.url()
|
||||||
href_preview = attachment_url["href"] |> MediaProxy.preview_url()
|
href_preview = attachment_url["href"] |> MediaProxy.preview_url()
|
||||||
meta = render("attachment_meta.json", %{attachment: attachment})
|
meta = render("attachment_meta.json", %{attachment: attachment})
|
||||||
|
|
||||||
|
|
@ -641,7 +642,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
||||||
%{
|
%{
|
||||||
id: attachment_id,
|
id: attachment_id,
|
||||||
url: href,
|
url: href,
|
||||||
remote_url: href,
|
remote_url: href_remote,
|
||||||
preview_url: href_preview,
|
preview_url: href_preview,
|
||||||
text_url: href,
|
text_url: href,
|
||||||
type: type,
|
type: type,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue