aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/activitypub/actor.ts7
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 @@
1import * as validator from 'validator' 1import * as validator from 'validator'
2import { CONSTRAINTS_FIELDS } from '../../../initializers' 2import { CONSTRAINTS_FIELDS } from '../../../initializers'
3import { exists } from '../misc' 3import { exists, isArray } from '../misc'
4import { truncate } from 'lodash' 4import { truncate } from 'lodash'
5import { isActivityPubUrlValid, isBaseActivityValid, setValidAttributedTo } from './misc' 5import { isActivityPubUrlValid, isBaseActivityValid, setValidAttributedTo } from './misc'
6import { isHostValid } from '../servers' 6import { 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
122function areValidActorHandles (handles: string[]) {
123 return isArray(handles) && handles.every(h => isValidActorHandle(h))
124}
125
122// --------------------------------------------------------------------------- 126// ---------------------------------------------------------------------------
123 127
124export { 128export {
125 normalizeActor, 129 normalizeActor,
130 areValidActorHandles,
126 isActorEndpointsObjectValid, 131 isActorEndpointsObjectValid,
127 isActorPublicKeyObjectValid, 132 isActorPublicKeyObjectValid,
128 isActorTypeValid, 133 isActorTypeValid,