mastodon api: rich media: don't clobber %URI struct with a string
This commit is contained in:
parent
c46490b199
commit
65a4b9fbea
|
@ -182,11 +182,13 @@ def render("status.json", _) 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 New Issue