]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/requests/activitypub.ts
Merge branch 'release/3.3.0' into develop
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / requests / activitypub.ts
index 2a7f20289ff52492a5060c3a8647392805162897..4ae878384bba5543e59ca6bde62a42121b73db32 100644 (file)
@@ -1,7 +1,7 @@
+import { activityPubContextify } from '../../../server/helpers/activitypub'
 import { doRequest } from '../../../server/helpers/requests'
 import { HTTP_SIGNATURE } from '../../../server/initializers/constants'
 import { buildGlobalHeaders } from '../../../server/lib/job-queue/handlers/utils/activitypub-http-utils'
-import { activityPubContextify } from '../../../server/helpers/activitypub'
 
 function makePOSTAPRequest (url: string, body: any, httpSignature: any, headers: any) {
   const options = {
@@ -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 {