diff options
Diffstat (limited to 'shared/extra-utils/server')
-rw-r--r-- | shared/extra-utils/server/activitypub.ts | 3 | ||||
-rw-r--r-- | shared/extra-utils/server/redundancy.ts | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/shared/extra-utils/server/activitypub.ts b/shared/extra-utils/server/activitypub.ts index eccb198ca..cf967ed7d 100644 --- a/shared/extra-utils/server/activitypub.ts +++ b/shared/extra-utils/server/activitypub.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import * as request from 'supertest' | 1 | import * as request from 'supertest' |
2 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
2 | 3 | ||
3 | function makeActivityPubGetRequest (url: string, path: string, expectedStatus = 200) { | 4 | function makeActivityPubGetRequest (url: string, path: string, expectedStatus = HttpStatusCode.OK_200) { |
4 | return request(url) | 5 | return request(url) |
5 | .get(path) | 6 | .get(path) |
6 | .set('Accept', 'application/activity+json,text/html;q=0.9,\\*/\\*;q=0.8') | 7 | .set('Accept', 'application/activity+json,text/html;q=0.9,\\*/\\*;q=0.8') |
diff --git a/shared/extra-utils/server/redundancy.ts b/shared/extra-utils/server/redundancy.ts index 3aca4ebfd..b83815a37 100644 --- a/shared/extra-utils/server/redundancy.ts +++ b/shared/extra-utils/server/redundancy.ts | |||
@@ -2,7 +2,13 @@ import { makeDeleteRequest, makeGetRequest, makePostBodyRequest, makePutBodyRequ | |||
2 | import { VideoRedundanciesTarget } from '@shared/models' | 2 | import { VideoRedundanciesTarget } from '@shared/models' |
3 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | 3 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' |
4 | 4 | ||
5 | function updateRedundancy (url: string, accessToken: string, host: string, redundancyAllowed: boolean, expectedStatus = 204) { | 5 | function updateRedundancy ( |
6 | url: string, | ||
7 | accessToken: string, | ||
8 | host: string, | ||
9 | redundancyAllowed: boolean, | ||
10 | expectedStatus = HttpStatusCode.NO_CONTENT_204 | ||
11 | ) { | ||
6 | const path = '/api/v1/server/redundancy/' + host | 12 | const path = '/api/v1/server/redundancy/' + host |
7 | 13 | ||
8 | return makePutBodyRequest({ | 14 | return makePutBodyRequest({ |