forked from mirrors/bookwyrm
Don't crash if nodeinfo is unavailable.
This commit is contained in:
parent
58630a053f
commit
52eeabc5bb
1 changed files with 4 additions and 0 deletions
|
@ -114,6 +114,10 @@ def get_or_create_remote_server(domain):
|
||||||
'https://%s/.well-known/nodeinfo' % domain,
|
'https://%s/.well-known/nodeinfo' % domain,
|
||||||
headers={'Accept': 'application/activity+json'}
|
headers={'Accept': 'application/activity+json'}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if response.status_code != 200:
|
||||||
|
return None
|
||||||
|
|
||||||
data = response.json()
|
data = response.json()
|
||||||
try:
|
try:
|
||||||
nodeinfo_url = data.get('links')[0].get('href')
|
nodeinfo_url = data.get('links')[0].get('href')
|
||||||
|
|
Loading…
Reference in a new issue