From fb82fd6583e981e4b3a6e4fa5e14812506833508 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 15 Jul 2019 10:20:16 +0100 Subject: [PATCH] Extra check on received posts --- inbox.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inbox.py b/inbox.py index f11d3a8d1..07adf893b 100644 --- a/inbox.py +++ b/inbox.py @@ -98,6 +98,8 @@ def inboxPermittedMessage(domain: str,messageJson: {},federationList: []) -> boo messageJson['type']!='Delete' and \ messageJson['type']!='Announce': if messageJson.get('object'): + if not isinstance(messageJson['object'], dict): + return False if messageJson['object'].get('inReplyTo'): inReplyTo=messageJson['object']['inReplyTo'] if not urlPermitted(inReplyTo,federationList): @@ -159,6 +161,7 @@ def savePostToInboxQueue(baseDir: str,httpPrefix: str,nickname: str, domain: str sharedInboxItem=True newQueueItem = { + 'id': postId, 'nickname': nickname, 'domain': domain, 'sharedInbox': sharedInboxItem,