1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

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
This commit is contained in:
Rigel Kent 2020-12-08 21:16:10 +01:00 committed by GitHub
parent c977fd3ec9
commit f2eb23cd87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 506 additions and 310 deletions

View file

@ -1,5 +1,6 @@
import { Redis } from '../lib/redis'
import * as apicache from 'apicache'
import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes'
// Ensure Redis is initialized
Redis.Instance.init()
@ -8,7 +9,10 @@ const defaultOptions = {
redisClient: Redis.Instance.getClient(),
appendKey: () => Redis.Instance.getPrefix(),
statusCodes: {
exclude: [ 404, 403 ]
exclude: [
HttpStatusCode.FORBIDDEN_403,
HttpStatusCode.NOT_FOUND_404
]
}
}