aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/activitypub/actor.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-02-28 16:03:39 +0100
committerChocobozzz <me@florianbigard.com>2020-02-28 16:21:34 +0100
commitbdd428a6d9138d751f8cde82867022a93f1a76cc (patch)
treec2b671c3d6a34daddd20e30656f573cf59905f13 /server/helpers/custom-validators/activitypub/actor.ts
parent9d94e5d7b96332d628ed835c67c2986289ead9b2 (diff)
downloadPeerTube-bdd428a6d9138d751f8cde82867022a93f1a76cc.tar.gz
PeerTube-bdd428a6d9138d751f8cde82867022a93f1a76cc.tar.zst
PeerTube-bdd428a6d9138d751f8cde82867022a93f1a76cc.zip
Update dependencies
Diffstat (limited to 'server/helpers/custom-validators/activitypub/actor.ts')
-rw-r--r--server/helpers/custom-validators/activitypub/actor.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/activitypub/actor.ts b/server/helpers/custom-validators/activitypub/actor.ts
index fec67823d..2f44522a5 100644
--- a/server/helpers/custom-validators/activitypub/actor.ts
+++ b/server/helpers/custom-validators/activitypub/actor.ts
@@ -28,7 +28,7 @@ function isActorPublicKeyValid (publicKey: string) {
28 return exists(publicKey) && 28 return exists(publicKey) &&
29 typeof publicKey === 'string' && 29 typeof publicKey === 'string' &&
30 publicKey.startsWith('-----BEGIN PUBLIC KEY-----') && 30 publicKey.startsWith('-----BEGIN PUBLIC KEY-----') &&
31 publicKey.indexOf('-----END PUBLIC KEY-----') !== -1 && 31 publicKey.includes('-----END PUBLIC KEY-----') &&
32 validator.isLength(publicKey, CONSTRAINTS_FIELDS.ACTORS.PUBLIC_KEY) 32 validator.isLength(publicKey, CONSTRAINTS_FIELDS.ACTORS.PUBLIC_KEY)
33} 33}
34 34
@@ -43,7 +43,7 @@ function isActorPrivateKeyValid (privateKey: string) {
43 typeof privateKey === 'string' && 43 typeof privateKey === 'string' &&
44 privateKey.startsWith('-----BEGIN RSA PRIVATE KEY-----') && 44 privateKey.startsWith('-----BEGIN RSA PRIVATE KEY-----') &&
45 // Sometimes there is a \n at the end, so just assert the string contains the end mark 45 // Sometimes there is a \n at the end, so just assert the string contains the end mark
46 privateKey.indexOf('-----END RSA PRIVATE KEY-----') !== -1 && 46 privateKey.includes('-----END RSA PRIVATE KEY-----') &&
47 validator.isLength(privateKey, CONSTRAINTS_FIELDS.ACTORS.PRIVATE_KEY) 47 validator.isLength(privateKey, CONSTRAINTS_FIELDS.ACTORS.PRIVATE_KEY)
48} 48}
49 49