From: William Pitcock Date: Wed, 6 Feb 2019 18:02:15 +0000 (+0000) Subject: mastodon api: rich media: don't clobber %URI struct with a string X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=65a4b9fbea6e1ec331e6aae30abe12e6d4494102;p=akkoma mastodon api: rich media: don't clobber %URI struct with a string --- diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index c0e289ef8..a227d742d 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -182,11 +182,13 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do end def render("card.json", %{rich_media: rich_media, page_url: page_url}) do + page_url_data = URI.parse(page_url) + page_url_data = 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 - page_url + page_url_data end page_url = page_url_data |> to_string