From 6822cfabf1f8c82a5beb43d6d1a56d26207511dd Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 10 Nov 2021 16:39:22 +0100 Subject: [PATCH] Add a default name for media if none is specified in AP Signed-off-by: Thomas Citharel --- lib/federation/activity_stream/converter/media.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/federation/activity_stream/converter/media.ex b/lib/federation/activity_stream/converter/media.ex index 6b63caabe..42ff958fd 100644 --- a/lib/federation/activity_stream/converter/media.ex +++ b/lib/federation/activity_stream/converter/media.ex @@ -66,6 +66,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Media do end @spec upload_media(String.t(), String.t()) :: {:ok, map()} | {:error, atom() | String.t()} + defp upload_media(media_url, ""), do: upload_media(media_url, "unknown") + defp upload_media(media_url, name) do case Tesla.get(media_url, opts: @http_options) do {:ok, %{body: body}} ->