aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/shared/requests.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/shared/requests.ts')
-rw-r--r--server/tests/shared/requests.ts12
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 @@
1import { doRequest } from '@server/helpers/requests'
2import { activityPubContextify } from '@server/helpers/activitypub' 1import { activityPubContextify } from '@server/helpers/activitypub'
3import { HTTP_SIGNATURE } from '@server/initializers/constants' 2import { buildDigest } from '@server/helpers/peertube-crypto'
4import { buildGlobalHeaders } from '@server/lib/job-queue/handlers/utils/activitypub-http-utils' 3import { doRequest } from '@server/helpers/requests'
4import { ACTIVITY_PUB, HTTP_SIGNATURE } from '@server/initializers/constants'
5 5
6export function makePOSTAPRequest (url: string, body: any, httpSignature: any, headers: any) { 6export 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}