diff options
Diffstat (limited to 'server/tests/shared/requests.ts')
-rw-r--r-- | server/tests/shared/requests.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/server/tests/shared/requests.ts b/server/tests/shared/requests.ts index 9eb596029..7f1acc0e1 100644 --- a/server/tests/shared/requests.ts +++ b/server/tests/shared/requests.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { doRequest } from '@server/helpers/requests' | ||
2 | import { activityPubContextify } from '@server/helpers/activitypub' | 1 | import { activityPubContextify } from '@server/helpers/activitypub' |
3 | import { HTTP_SIGNATURE } from '@server/initializers/constants' | 2 | import { buildDigest } from '@server/helpers/peertube-crypto' |
4 | import { buildGlobalHeaders } from '@server/lib/job-queue/handlers/utils/activitypub-http-utils' | 3 | import { doRequest } from '@server/helpers/requests' |
4 | import { ACTIVITY_PUB, HTTP_SIGNATURE } from '@server/initializers/constants' | ||
5 | 5 | ||
6 | export function makePOSTAPRequest (url: string, body: any, httpSignature: any, headers: any) { | 6 | export function makePOSTAPRequest (url: string, body: any, httpSignature: any, headers: any) { |
7 | const options = { | 7 | const options = { |
@@ -31,7 +31,11 @@ export async function makeFollowRequest (to: { url: string }, by: { url: string, | |||
31 | key: by.privateKey, | 31 | key: by.privateKey, |
32 | headers: HTTP_SIGNATURE.HEADERS_TO_SIGN | 32 | headers: HTTP_SIGNATURE.HEADERS_TO_SIGN |
33 | } | 33 | } |
34 | const headers = buildGlobalHeaders(body) | 34 | const headers = { |
35 | 'digest': buildDigest(body), | ||
36 | 'content-type': 'application/activity+json', | ||
37 | 'accept': ACTIVITY_PUB.ACCEPT_HEADER | ||
38 | } | ||
35 | 39 | ||
36 | return makePOSTAPRequest(to.url + '/inbox', body, httpSignature, headers) | 40 | return makePOSTAPRequest(to.url + '/inbox', body, httpSignature, headers) |
37 | } | 41 | } |