Added proper header when querying activity pub actor

This commit is contained in:
Eliot Berriot 2018-03-31 18:41:35 +02:00
parent ee0341ba1a
commit 741ab533b1
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
1 changed files with 11 additions and 3 deletions

View File

@ -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': {