diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-17 11:58:15 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-17 12:24:03 +0100 |
commit | c55e3d7227fe1453869e309025996b9d75256d5d (patch) | |
tree | 08e9b0ca210d75c82c8606fef0852eca020e8e0e /server/tests/shared/requests.ts | |
parent | bf54587a3e2ad9c2c186828f2a5682b91ee2cc00 (diff) | |
download | PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.tar.gz PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.tar.zst PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.zip |
Move test functions outside extra-utils
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 | } |