]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/activitypub/actor.ts
Add totalLocalVideoFilesSize in stats
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / activitypub / actor.ts
index 6958b2b00568b6094f9b7dd042a54ea2bf14e1e7..070632a20cbd77ab6d3c7e169460a4608b930b6f 100644 (file)
@@ -27,7 +27,8 @@ function isActorPublicKeyValid (publicKey: string) {
     validator.isLength(publicKey, CONSTRAINTS_FIELDS.ACTORS.PUBLIC_KEY)
 }
 
-const actorNameRegExp = new RegExp('^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_]+$')
+const actorNameAlphabet = '[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_.]'
+const actorNameRegExp = new RegExp(`^${actorNameAlphabet}+$`)
 function isActorPreferredUsernameValid (preferredUsername: string) {
   return exists(preferredUsername) && validator.matches(preferredUsername, actorNameRegExp)
 }
@@ -127,6 +128,7 @@ function areValidActorHandles (handles: string[]) {
 
 export {
   normalizeActor,
+  actorNameAlphabet,
   areValidActorHandles,
   isActorEndpointsObjectValid,
   isActorPublicKeyObjectValid,