From 90417b5f8e96928c0ec9d7e64780718835655959 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 19 Jul 2021 09:59:30 +0100 Subject: [PATCH] More checking for actor updates --- outbox.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/outbox.py b/outbox.py index 6dc12b193..731ba1aed 100644 --- a/outbox.py +++ b/outbox.py @@ -62,7 +62,10 @@ def _outboxPersonReceiveUpdate(recentPostsCache: {}, if not messageJson.get('type'): return - print("messageJson['type'] " + messageJson['type']) + if not isinstance(messageJson['type'], str): + if debug: + print('DEBUG: c2s actor update type is not a string') + return if messageJson['type'] != 'Update': return if not hasObjectDict(messageJson): @@ -73,6 +76,10 @@ def _outboxPersonReceiveUpdate(recentPostsCache: {}, if debug: print('DEBUG: c2s actor update - no type') return + if not isinstance(messageJson['object']['type'], str): + if debug: + print('DEBUG: c2s actor update object type is not a string') + return if messageJson['object']['type'] != 'Person': if debug: print('DEBUG: not a c2s actor update') @@ -89,6 +96,10 @@ def _outboxPersonReceiveUpdate(recentPostsCache: {}, if debug: print('DEBUG: c2s actor update has no id field') return + if not isinstance(messageJson['id'], str): + if debug: + print('DEBUG: c2s actor update id is not a string') + return actor = \ httpPrefix + '://' + getFullDomain(domain, port) + '/users/' + nickname if len(messageJson['to']) != 1: