Don't allow empty or bad actor responses

This commit is contained in:
Andrew Godwin 2022-12-21 16:13:36 +00:00
parent 480fa70b1f
commit 3f37c7ffe7

View file

@ -470,6 +470,8 @@ class Identity(StatorModel):
f"Client error fetching actor: {response.status_code}", response.content
)
document = canonicalise(response.json(), include_security=True)
if "type" not in document:
return False
self.name = document.get("name")
self.profile_uri = document.get("url")
self.inbox_uri = document.get("inbox")