diff options
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r-- | server/helpers/custom-validators/activitypub/actor.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/activitypub/actor.ts b/server/helpers/custom-validators/activitypub/actor.ts index c3a62c12d..6958b2b00 100644 --- a/server/helpers/custom-validators/activitypub/actor.ts +++ b/server/helpers/custom-validators/activitypub/actor.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as validator from 'validator' | 1 | import * as validator from 'validator' |
2 | import { CONSTRAINTS_FIELDS } from '../../../initializers' | 2 | import { CONSTRAINTS_FIELDS } from '../../../initializers' |
3 | import { exists } from '../misc' | 3 | import { exists, isArray } from '../misc' |
4 | import { truncate } from 'lodash' | 4 | import { truncate } from 'lodash' |
5 | import { isActivityPubUrlValid, isBaseActivityValid, setValidAttributedTo } from './misc' | 5 | import { isActivityPubUrlValid, isBaseActivityValid, setValidAttributedTo } from './misc' |
6 | import { isHostValid } from '../servers' | 6 | import { isHostValid } from '../servers' |
@@ -119,10 +119,15 @@ function isValidActorHandle (handle: string) { | |||
119 | return isHostValid(parts[1]) | 119 | return isHostValid(parts[1]) |
120 | } | 120 | } |
121 | 121 | ||
122 | function areValidActorHandles (handles: string[]) { | ||
123 | return isArray(handles) && handles.every(h => isValidActorHandle(h)) | ||
124 | } | ||
125 | |||
122 | // --------------------------------------------------------------------------- | 126 | // --------------------------------------------------------------------------- |
123 | 127 | ||
124 | export { | 128 | export { |
125 | normalizeActor, | 129 | normalizeActor, |
130 | areValidActorHandles, | ||
126 | isActorEndpointsObjectValid, | 131 | isActorEndpointsObjectValid, |
127 | isActorPublicKeyObjectValid, | 132 | isActorPublicKeyObjectValid, |
128 | isActorTypeValid, | 133 | isActorTypeValid, |