From efee8f45f96bc4ac6885d794ffe246516fb77b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A1=E3=82=83=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Sun, 31 Dec 2023 12:17:18 +0900 Subject: [PATCH] =?UTF-8?q?fix(Queue):=20Inbox=E3=82=84Deliver=E3=82=AD?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=81=ABdata=E3=83=95=E3=82=A3=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=83=89=E3=81=8C=E7=A9=BA=E3=81=AE=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=96=E3=81=8C=E7=99=BB=E9=8C=B2=E3=81=95=E3=82=8C=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=20(MisskeyIO#307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/QueueService.ts | 2 +- packages/backend/src/server/ActivityPubServerService.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/QueueService.ts b/packages/backend/src/core/QueueService.ts index c999e7316..58c095363 100644 --- a/packages/backend/src/core/QueueService.ts +++ b/packages/backend/src/core/QueueService.ts @@ -121,7 +121,7 @@ export class QueueService { content, to: d[0], isSharedInbox: d[1], - } as DeliverJobData, + }, opts, }))); diff --git a/packages/backend/src/server/ActivityPubServerService.ts b/packages/backend/src/server/ActivityPubServerService.ts index f87cb14dc..a1dcc4f48 100644 --- a/packages/backend/src/server/ActivityPubServerService.ts +++ b/packages/backend/src/server/ActivityPubServerService.ts @@ -162,7 +162,13 @@ export class ActivityPubServerService { } } - this.queueService.inbox(request.body as IActivity, signature); + const activity = request.body as IActivity; + if (!activity.type || !signature.keyId) { + reply.code(400); + return; + } + + this.queueService.inbox(activity, signature); reply.code(202); }