diff options
Diffstat (limited to 'server/middlewares/validators/activitypub/activity.ts')
-rw-r--r-- | server/middlewares/validators/activitypub/activity.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/server/middlewares/validators/activitypub/activity.ts b/server/middlewares/validators/activitypub/activity.ts index 59355e855..cc6acd4b1 100644 --- a/server/middlewares/validators/activitypub/activity.ts +++ b/server/middlewares/validators/activitypub/activity.ts | |||
@@ -9,16 +9,14 @@ async function activityPubValidator (req: express.Request, res: express.Response | |||
9 | 9 | ||
10 | if (!isRootActivityValid(req.body)) { | 10 | if (!isRootActivityValid(req.body)) { |
11 | logger.warn('Incorrect activity parameters.', { activity: req.body }) | 11 | logger.warn('Incorrect activity parameters.', { activity: req.body }) |
12 | return res.status(HttpStatusCode.BAD_REQUEST_400) | 12 | return res.fail({ message: 'Incorrect activity' }) |
13 | .end() | ||
14 | } | 13 | } |
15 | 14 | ||
16 | const serverActor = await getServerActor() | 15 | const serverActor = await getServerActor() |
17 | const remoteActor = res.locals.signature.actor | 16 | const remoteActor = res.locals.signature.actor |
18 | if (serverActor.id === remoteActor.id || remoteActor.serverId === null) { | 17 | if (serverActor.id === remoteActor.id || remoteActor.serverId === null) { |
19 | logger.error('Receiving request in INBOX by ourselves!', req.body) | 18 | logger.error('Receiving request in INBOX by ourselves!', req.body) |
20 | return res.status(HttpStatusCode.CONFLICT_409) | 19 | return res.status(HttpStatusCode.CONFLICT_409).end() |
21 | .end() | ||
22 | } | 20 | } |
23 | 21 | ||
24 | return next() | 22 | return next() |