Additional type checks when receiving post

main
Bob Mottram 2020-09-05 17:46:03 +01:00
parent 2135525d2b
commit 5016a3b2df
1 changed files with 4 additions and 0 deletions

View File

@ -319,6 +319,8 @@ def savePostToInboxQueue(baseDir: str, httpPrefix: str,
postDomain = None
actor = None
if postJsonObject.get('actor'):
if not isinstance(postJsonObject['actor'], str):
return None
actor = postJsonObject['actor']
postNickname = getNicknameFromActor(postJsonObject['actor'])
if not postNickname:
@ -371,6 +373,8 @@ def savePostToInboxQueue(baseDir: str, httpPrefix: str,
return None
originalPostId = None
if postJsonObject.get('id'):
if not isinstance(postJsonObject['id'], str):
return None
originalPostId = removeIdEnding(postJsonObject['id'])
currTime = datetime.datetime.utcnow()