From: rinpatch Date: Sat, 2 Feb 2019 08:38:37 +0000 (+0300) Subject: Fix rich media relative path X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=cbadf9d3333d3840d21cfcd3bd4f33d3b5b90445;p=akkoma Fix rich media relative path --- diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index d5b7e68c7..826563f74 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -184,6 +184,11 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do def render("card.json", %{rich_media: rich_media, page_url: page_url}) do page_url = rich_media[:url] || page_url page_url_data = URI.parse(page_url) + + image_url = + URI.merge(page_url_data, URI.parse(rich_media[:image])) + |> to_string + site_name = rich_media[:site_name] || page_url_data.host %{ @@ -191,7 +196,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do provider_name: site_name, provider_url: page_url_data.scheme <> "://" <> page_url_data.host, url: page_url, - image: rich_media[:image] |> MediaProxy.url(), + image: image_url |> MediaProxy.url(), title: rich_media[:title], description: rich_media[:description], pleroma: %{