aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/custom-validators/activitypub/activity.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/activitypub/activity.ts b/server/helpers/custom-validators/activitypub/activity.ts
index cabedaf20..1d2ef2ac6 100644
--- a/server/helpers/custom-validators/activitypub/activity.ts
+++ b/server/helpers/custom-validators/activitypub/activity.ts
@@ -18,7 +18,7 @@ import {
18import { isViewActivityValid } from './view' 18import { isViewActivityValid } from './view'
19 19
20function isRootActivityValid (activity: any) { 20function isRootActivityValid (activity: any) {
21 return Array.isArray(activity['@context']) && 21 return Array.isArray(activity['@context']) && (
22 ( 22 (
23 (activity.type === 'Collection' || activity.type === 'OrderedCollection') && 23 (activity.type === 'Collection' || activity.type === 'OrderedCollection') &&
24 validator.isInt(activity.totalItems, { min: 0 }) && 24 validator.isInt(activity.totalItems, { min: 0 }) &&
@@ -28,6 +28,7 @@ function isRootActivityValid (activity: any) {
28 isActivityPubUrlValid(activity.id) && 28 isActivityPubUrlValid(activity.id) &&
29 (isActivityPubUrlValid(activity.actor) || isActivityPubUrlValid(activity.actor.id)) 29 (isActivityPubUrlValid(activity.actor) || isActivityPubUrlValid(activity.actor.id))
30 ) 30 )
31 )
31} 32}
32 33
33const activityCheckers: { [ P in ActivityType ]: (activity: Activity) => boolean } = { 34const activityCheckers: { [ P in ActivityType ]: (activity: Activity) => boolean } = {