diff --git a/api/funkwhale_api/federation/actors.py b/api/funkwhale_api/federation/actors.py index 823d163f9790c103d398cf1eaf3ec2d39f52c5c5..56a3fc1faf8bd5b913c5bfae59e55d72d2d4a82e 100644 --- a/api/funkwhale_api/federation/actors.py +++ b/api/funkwhale_api/federation/actors.py @@ -10,10 +10,18 @@ from . import utils def get_actor_data(actor_url): - response = requests.get(actor_url) + response = requests.get( + actor_url, + headers={ + 'Accept': 'application/activity+json', + } + ) response.raise_for_status() - return response.json() - + try: + return response.json() + except: + raise ValueError( + 'Invalid actor payload: {}'.format(response.text)) SYSTEM_ACTORS = { 'library': {