diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-12-08 21:16:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 21:16:10 +0100 |
commit | f2eb23cd87cf32b8fe545178143b5f49e06a58da (patch) | |
tree | af7d59945af70e28fd85047e2c688c59a908f548 /shared/extra-utils/server/redundancy.ts | |
parent | c977fd3ec931c059111ddb2b8d6ddbb20b6b99a1 (diff) | |
download | PeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.tar.gz PeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.tar.zst PeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.zip |
emit more specific status codes on video upload (#3423)
- reduce http status codes list to potentially useful codes
- convert more codes to typed ones
- factorize html generator for error responses
Diffstat (limited to 'shared/extra-utils/server/redundancy.ts')
-rw-r--r-- | shared/extra-utils/server/redundancy.ts | 8 |
1 files changed, 7 insertions, 1 deletions
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({ |