diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-23 17:58:39 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-27 09:41:54 +0200 |
commit | f37dc0dd14d9ce0b59c454c2c1b935fcbe9727e9 (patch) | |
tree | 2050443febcdb2a3eec68b7bbf9687e26dcb24dc /server/helpers | |
parent | 240085d0056fd97ac3c7fa8fa4ce9bc32afc4d6e (diff) | |
download | PeerTube-f37dc0dd14d9ce0b59c454c2c1b935fcbe9727e9.tar.gz PeerTube-f37dc0dd14d9ce0b59c454c2c1b935fcbe9727e9.tar.zst PeerTube-f37dc0dd14d9ce0b59c454c2c1b935fcbe9727e9.zip |
Add ability to search video channels
Diffstat (limited to 'server/helpers')
-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, |