From 61d6715714fe9c2ce6bf4fe6afc353f7fe5502a6 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Mon, 28 Jan 2019 21:07:36 +0000 Subject: rich media: oembed: return data in the same format as the other parsers --- lib/pleroma/web/rich_media/parsers/oembed_parser.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/pleroma/web/rich_media/parsers/oembed_parser.ex b/lib/pleroma/web/rich_media/parsers/oembed_parser.ex index ca7226faf..efa98bc2c 100644 --- a/lib/pleroma/web/rich_media/parsers/oembed_parser.ex +++ b/lib/pleroma/web/rich_media/parsers/oembed_parser.ex @@ -22,6 +22,10 @@ defmodule Pleroma.Web.RichMedia.Parsers.OEmbed do defp get_oembed_data(url) do {:ok, %Tesla.Env{body: json}} = Pleroma.HTTP.get(url) - {:ok, Poison.decode!(json)} + {:ok, data} = Jason.decode(json) + + data = data |> Map.new(fn {k, v} -> {String.to_atom(k), v} end) + + {:ok, data} end end -- cgit v1.2.3