diff options
Diffstat (limited to 'server/helpers/custom-validators/activitypub/misc.ts')
-rw-r--r-- | server/helpers/custom-validators/activitypub/misc.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/activitypub/misc.ts b/server/helpers/custom-validators/activitypub/misc.ts index f1762d11c..5afcfbedc 100644 --- a/server/helpers/custom-validators/activitypub/misc.ts +++ b/server/helpers/custom-validators/activitypub/misc.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as validator from 'validator' | 1 | import * as validator from 'validator' |
2 | import { CONSTRAINTS_FIELDS } from '../../../initializers' | 2 | import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' |
3 | import { isTestInstance } from '../../core-utils' | 3 | import { isTestInstance } from '../../core-utils' |
4 | import { exists } from '../misc' | 4 | import { exists } from '../misc' |
5 | 5 | ||
@@ -25,8 +25,7 @@ function isActivityPubUrlValid (url: string) { | |||
25 | } | 25 | } |
26 | 26 | ||
27 | function isBaseActivityValid (activity: any, type: string) { | 27 | function isBaseActivityValid (activity: any, type: string) { |
28 | return (activity['@context'] === undefined || Array.isArray(activity['@context'])) && | 28 | return activity.type === type && |
29 | activity.type === type && | ||
30 | isActivityPubUrlValid(activity.id) && | 29 | isActivityPubUrlValid(activity.id) && |
31 | isObjectValid(activity.actor) && | 30 | isObjectValid(activity.actor) && |
32 | isUrlCollectionValid(activity.to) && | 31 | isUrlCollectionValid(activity.to) && |