twitter api: fix mimetype fallback when attachments use a URI instead of a URL object
authorWilliam Pitcock <nenolod@dereferenced.org>
Wed, 19 Sep 2018 04:58:17 +0000 (04:58 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Wed, 19 Sep 2018 04:59:26 +0000 (04:59 +0000)
lib/pleroma/web/twitter_api/representers/object_representer.ex

index 6aa794a59d5d219f13f8e94d5fa68453a727e258..d5291a397ca5d0b5ebd67d902cd43c430ef7d7f7 100644 (file)
@@ -17,7 +17,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter do
   def to_map(%Object{data: %{"url" => url} = data}, _opts) when is_binary(url) do
     %{
       url: url |> Pleroma.Web.MediaProxy.url(),
-      mimetype: data["mediaType"] || url["mimeType"],
+      mimetype: data["mediaType"] || data["mimeType"],
       id: data["uuid"],
       oembed: false,
       description: data["name"]