Don't crash if nodeinfo is unavailable.

This commit is contained in:
Adam Kelly 2020-05-19 21:58:30 +01:00
parent 58630a053f
commit 52eeabc5bb

View file

@ -114,6 +114,10 @@ def get_or_create_remote_server(domain):
'https://%s/.well-known/nodeinfo' % domain,
headers={'Accept': 'application/activity+json'}
)
if response.status_code != 200:
return None
data = response.json()
try:
nodeinfo_url = data.get('links')[0].get('href')