diff options
Diffstat (limited to 'shared/extra-utils/requests')
-rw-r--r-- | shared/extra-utils/requests/activitypub.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/shared/extra-utils/requests/activitypub.ts b/shared/extra-utils/requests/activitypub.ts index 4762a8665..ecd8ce823 100644 --- a/shared/extra-utils/requests/activitypub.ts +++ b/shared/extra-utils/requests/activitypub.ts | |||
@@ -5,20 +5,19 @@ import { activityPubContextify } from '../../../server/helpers/activitypub' | |||
5 | 5 | ||
6 | function makePOSTAPRequest (url: string, body: any, httpSignature: any, headers: any) { | 6 | function makePOSTAPRequest (url: string, body: any, httpSignature: any, headers: any) { |
7 | const options = { | 7 | const options = { |
8 | method: 'POST', | 8 | method: 'POST' as 'POST', |
9 | uri: url, | ||
10 | json: body, | 9 | json: body, |
11 | httpSignature, | 10 | httpSignature, |
12 | headers | 11 | headers |
13 | } | 12 | } |
14 | 13 | ||
15 | return doRequest(options) | 14 | return doRequest(url, options) |
16 | } | 15 | } |
17 | 16 | ||
18 | async function makeFollowRequest (to: { url: string }, by: { url: string, privateKey }) { | 17 | async function makeFollowRequest (to: { url: string }, by: { url: string, privateKey }) { |
19 | const follow = { | 18 | const follow = { |
20 | type: 'Follow', | 19 | type: 'Follow', |
21 | id: by.url + '/toto', | 20 | id: by.url + '/' + new Date().getTime(), |
22 | actor: by.url, | 21 | actor: by.url, |
23 | object: to.url | 22 | object: to.url |
24 | } | 23 | } |
@@ -34,7 +33,7 @@ async function makeFollowRequest (to: { url: string }, by: { url: string, privat | |||
34 | } | 33 | } |
35 | const headers = buildGlobalHeaders(body) | 34 | const headers = buildGlobalHeaders(body) |
36 | 35 | ||
37 | return makePOSTAPRequest(to.url, body, httpSignature, headers) | 36 | return makePOSTAPRequest(to.url + '/inbox', body, httpSignature, headers) |
38 | } | 37 | } |
39 | 38 | ||
40 | export { | 39 | export { |