Merge branch 'handle-ap-fetcher-when-not-json' into 'master'

Handle ActivityPub Fetcher returning text that's not JSON

See merge request framasoft/mobilizon!861
This commit is contained in:
Thomas Citharel 2021-03-16 16:38:29 +00:00
commit 49b4c28378

View file

@ -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