Commit 65a4b9fb authored by kaniini's avatar kaniini

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

parent c46490b1
Pipeline #7171 passed with stages
in 6 minutes and 36 seconds
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment