Extra check on received posts

master
Bob Mottram 2019-07-15 10:20:16 +01:00
parent 88e26a57af
commit fb82fd6583
1 changed files with 3 additions and 0 deletions

View File

@ -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,