]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/requests/activitypub.ts
Fix AP security tests
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / requests / activitypub.ts
index 2a7f20289ff52492a5060c3a8647392805162897..ecd8ce82389d5e31de01fbd78922992c07cb594c 100644 (file)
@@ -17,7 +17,7 @@ function makePOSTAPRequest (url: string, body: any, httpSignature: any, headers:
 async function makeFollowRequest (to: { url: string }, by: { url: string, privateKey }) {
   const follow = {
     type: 'Follow',
-    id: by.url + '/toto',
+    id: by.url + '/' + new Date().getTime(),
     actor: by.url,
     object: to.url
   }
@@ -33,7 +33,7 @@ async function makeFollowRequest (to: { url: string }, by: { url: string, privat
   }
   const headers = buildGlobalHeaders(body)
 
-  return makePOSTAPRequest(to.url, body, httpSignature, headers)
+  return makePOSTAPRequest(to.url + '/inbox', body, httpSignature, headers)
 }
 
 export {