From 2abadb183f1e67ae40cb18f1aa5c26adaeecd687 Mon Sep 17 00:00:00 2001 From: freamon Date: Sat, 25 May 2024 19:43:25 +0100 Subject: [PATCH] PeerTube: 'Follow' requests are acknowledged with a 204 status code --- app/activitypub/signature.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/activitypub/signature.py b/app/activitypub/signature.py index 1ba5e1db..9aeb9553 100644 --- a/app/activitypub/signature.py +++ b/app/activitypub/signature.py @@ -101,7 +101,7 @@ def post_request(uri: str, body: dict | None, private_key: str, key_id: str, con else: try: result = HttpSignature.signed_request(uri, body, private_key, key_id, content_type, method, timeout) - if result.status_code != 200 and result.status_code != 202: + if result.status_code != 200 and result.status_code != 202 and result.status_code != 204: log.result = 'failure' log.exception_message += f' Response status code was {result.status_code}' current_app.logger.error('Response code for post attempt was ' + @@ -109,6 +109,8 @@ def post_request(uri: str, body: dict | None, private_key: str, key_id: str, con log.exception_message += uri if result.status_code == 202: log.exception_message += ' 202' + if result.status_code == 204: + log.exception_message += ' 204' except Exception as e: log.result = 'failure' log.exception_message='could not send:' + str(e)