]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/activitypub.ts
Redirect to uuid video route after upload
[github/Chocobozzz/PeerTube.git] / server / middlewares / activitypub.ts
index 37b7c42ec3c49db64e4763202728cd5a27e8001d..c00a6affa07892777ccf4394940f9acf060d0057 100644 (file)
@@ -9,11 +9,13 @@ import { ActorModel } from '../models/activitypub/actor'
 async function checkSignature (req: Request, res: Response, next: NextFunction) {
   const signatureObject: ActivityPubSignature = req.body.signature
 
-  logger.debug('Checking signature of actor %s...', signatureObject.creator)
+  const [ creator ] = signatureObject.creator.split('#')
+
+  logger.debug('Checking signature of actor %s...', creator)
 
   let actor: ActorModel
   try {
-    actor = await getOrCreateActorAndServerAndModel(signatureObject.creator)
+    actor = await getOrCreateActorAndServerAndModel(creator)
   } catch (err) {
     logger.error('Cannot create remote actor and check signature.', err)
     return res.sendStatus(403)