Handle ActivityPub Fetcher returning text that's not JSON
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
27a1d92e52
commit
6fe22ac6ed
@ -59,6 +59,10 @@ defmodule Mobilizon.Federation.ActivityPub.Fetcher do
|
||||
Logger.warn("Object origin check failed")
|
||||
{:error, "Object origin check failed"}
|
||||
|
||||
# Returned content is not JSON
|
||||
{:ok, data} when is_binary(data) ->
|
||||
{:error, "Failed to parse content as JSON"}
|
||||
|
||||
{:error, err} ->
|
||||
{:error, err}
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user