mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-11-06 00:49:46 +00:00
mastodon api: rich media: don't clobber %URI struct with a string
This commit is contained in:
parent
c46490b199
commit
65a4b9fbea
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue