mastodon api: rich media: don't clobber %URI struct with a string

This commit is contained in:
William Pitcock 2019-02-06 18:02:15 +00:00
parent c46490b199
commit 65a4b9fbea

View File

@ -182,11 +182,13 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
end end
def render("card.json", %{rich_media: rich_media, page_url: page_url}) do def render("card.json", %{rich_media: rich_media, page_url: page_url}) do
page_url_data = URI.parse(page_url)
page_url_data = page_url_data =
if rich_media[:url] != nil do if rich_media[:url] != nil do
URI.merge(URI.parse(page_url), URI.parse(rich_media[:url])) URI.merge(page_url_data, URI.parse(rich_media[:url]))
else else
page_url page_url_data
end end
page_url = page_url_data |> to_string page_url = page_url_data |> to_string