Return 400 Bad Request for signature verification errors

This commit is contained in:
freamon 2024-08-15 13:10:37 +00:00
parent f247c280e9
commit 5211c64c2a

View file

@ -440,6 +440,9 @@ def shared_inbox():
return '' return ''
except VerificationError as e: except VerificationError as e:
activity_log.exception_message = 'Could not verify signature: ' + str(e) activity_log.exception_message = 'Could not verify signature: ' + str(e)
activity_log.result = 'failure'
db.session.commit()
return '', 400
else: else:
actor_name = request_json['actor'] if 'actor' in request_json else '' actor_name = request_json['actor'] if 'actor' in request_json else ''
activity_log.exception_message = f'Actor could not be found: {actor_name}' activity_log.exception_message = f'Actor could not be found: {actor_name}'