]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/activitypub/actor.ts
Merge branch 'release/3.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / activitypub / actor.ts
index 2f44522a5813979def3f09694ec5c7ce165bb920..87734515750ba812b9d8dcab552ef0d95f60d4d4 100644 (file)
@@ -62,6 +62,7 @@ function isActorObjectValid (actor: any) {
     (!actor.followers || isActivityPubUrlValid(actor.followers)) &&
 
     setValidAttributedTo(actor) &&
+    setValidDescription(actor) &&
     // If this is a group (a channel), it should be attributed to an account
     // In PeerTube we use this to attach a video channel to a specific account
     (actor.type !== 'Group' || actor.attributedTo.length !== 0)
@@ -116,6 +117,12 @@ function areValidActorHandles (handles: string[]) {
   return isArray(handles) && handles.every(h => isValidActorHandle(h))
 }
 
+function setValidDescription (obj: any) {
+  if (!obj.summary) obj.summary = null
+
+  return true
+}
+
 // ---------------------------------------------------------------------------
 
 export {