diff options
Diffstat (limited to 'server/helpers/custom-validators/activitypub/actor.ts')
-rw-r--r-- | server/helpers/custom-validators/activitypub/actor.ts | 4 |
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 | ||