aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/activitypub/actor.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-03 11:10:40 +0100
committerChocobozzz <me@florianbigard.com>2018-01-03 11:10:40 +0100
commit01de67b9a4fcdf01102ccc3cb7dc24beebf6c7ea (patch)
tree9e01809f09adbcd512a8dedf73093a123f88e02c /server/helpers/custom-validators/activitypub/actor.ts
parent47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04 (diff)
downloadPeerTube-01de67b9a4fcdf01102ccc3cb7dc24beebf6c7ea.tar.gz
PeerTube-01de67b9a4fcdf01102ccc3cb7dc24beebf6c7ea.tar.zst
PeerTube-01de67b9a4fcdf01102ccc3cb7dc24beebf6c7ea.zip
Add avatar max size limit
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 630bace30..700e06007 100644
--- a/server/helpers/custom-validators/activitypub/actor.ts
+++ b/server/helpers/custom-validators/activitypub/actor.ts
@@ -24,7 +24,7 @@ function isActorPublicKeyValid (publicKey: string) {
24 typeof publicKey === 'string' && 24 typeof publicKey === 'string' &&
25 publicKey.startsWith('-----BEGIN PUBLIC KEY-----') && 25 publicKey.startsWith('-----BEGIN PUBLIC KEY-----') &&
26 publicKey.indexOf('-----END PUBLIC KEY-----') !== -1 && 26 publicKey.indexOf('-----END PUBLIC KEY-----') !== -1 &&
27 validator.isLength(publicKey, CONSTRAINTS_FIELDS.ACTOR.PUBLIC_KEY) 27 validator.isLength(publicKey, CONSTRAINTS_FIELDS.ACTORS.PUBLIC_KEY)
28} 28}
29 29
30const actorNameRegExp = new RegExp('[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_]+') 30const actorNameRegExp = new RegExp('[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_]+')
@@ -42,7 +42,7 @@ function isActorPrivateKeyValid (privateKey: string) {
42 privateKey.startsWith('-----BEGIN RSA PRIVATE KEY-----') && 42 privateKey.startsWith('-----BEGIN RSA PRIVATE KEY-----') &&
43 // Sometimes there is a \n at the end, so just assert the string contains the end mark 43 // Sometimes there is a \n at the end, so just assert the string contains the end mark
44 privateKey.indexOf('-----END RSA PRIVATE KEY-----') !== -1 && 44 privateKey.indexOf('-----END RSA PRIVATE KEY-----') !== -1 &&
45 validator.isLength(privateKey, CONSTRAINTS_FIELDS.ACTOR.PRIVATE_KEY) 45 validator.isLength(privateKey, CONSTRAINTS_FIELDS.ACTORS.PRIVATE_KEY)
46} 46}
47 47
48function isRemoteActorValid (remoteActor: any) { 48function isRemoteActorValid (remoteActor: any) {