fix(Queue): InboxやDeliverキューにdataフィールドが空のジョブが登録されないように (MisskeyIO#307)

This commit is contained in:
まっちゃとーにゅ 2023-12-31 12:17:18 +09:00 committed by GitHub
parent c64be8b9f9
commit efee8f45f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -121,7 +121,7 @@ export class QueueService {
content, content,
to: d[0], to: d[0],
isSharedInbox: d[1], isSharedInbox: d[1],
} as DeliverJobData, },
opts, opts,
}))); })));

View file

@ -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); reply.code(202);
} }