aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/cache.ts2
-rw-r--r--server/middlewares/validators/videos.ts10
2 files changed, 11 insertions, 1 deletions
diff --git a/server/middlewares/cache.ts b/server/middlewares/cache.ts
index bf6659687..1de44db70 100644
--- a/server/middlewares/cache.ts
+++ b/server/middlewares/cache.ts
@@ -14,7 +14,7 @@ function cacheRoute (lifetime: number) {
14 14
15 // Not cached 15 // Not cached
16 if (!cached) { 16 if (!cached) {
17 logger.debug('Not cached result for route %s.', req.originalUrl) 17 logger.debug('No cached results for route %s.', req.originalUrl)
18 18
19 const sendSave = res.send.bind(res) 19 const sendSave = res.send.bind(res)
20 20
diff --git a/server/middlewares/validators/videos.ts b/server/middlewares/validators/videos.ts
index c5c45fe58..e181aebdb 100644
--- a/server/middlewares/validators/videos.ts
+++ b/server/middlewares/validators/videos.ts
@@ -55,8 +55,13 @@ const videosAddValidator = [
55 .customSanitizer(toValueOrNull) 55 .customSanitizer(toValueOrNull)
56 .custom(isVideoLanguageValid).withMessage('Should have a valid language'), 56 .custom(isVideoLanguageValid).withMessage('Should have a valid language'),
57 body('nsfw') 57 body('nsfw')
58 .optional()
58 .toBoolean() 59 .toBoolean()
59 .custom(isBooleanValid).withMessage('Should have a valid NSFW attribute'), 60 .custom(isBooleanValid).withMessage('Should have a valid NSFW attribute'),
61 body('waitTranscoding')
62 .optional()
63 .toBoolean()
64 .custom(isBooleanValid).withMessage('Should have a valid wait transcoding attribute'),
60 body('description') 65 body('description')
61 .optional() 66 .optional()
62 .customSanitizer(toValueOrNull) 67 .customSanitizer(toValueOrNull)
@@ -70,6 +75,7 @@ const videosAddValidator = [
70 .customSanitizer(toValueOrNull) 75 .customSanitizer(toValueOrNull)
71 .custom(isVideoTagsValid).withMessage('Should have correct tags'), 76 .custom(isVideoTagsValid).withMessage('Should have correct tags'),
72 body('commentsEnabled') 77 body('commentsEnabled')
78 .optional()
73 .toBoolean() 79 .toBoolean()
74 .custom(isBooleanValid).withMessage('Should have comments enabled boolean'), 80 .custom(isBooleanValid).withMessage('Should have comments enabled boolean'),
75 body('privacy') 81 body('privacy')
@@ -149,6 +155,10 @@ const videosUpdateValidator = [
149 .optional() 155 .optional()
150 .toBoolean() 156 .toBoolean()
151 .custom(isBooleanValid).withMessage('Should have a valid NSFW attribute'), 157 .custom(isBooleanValid).withMessage('Should have a valid NSFW attribute'),
158 body('waitTranscoding')
159 .optional()
160 .toBoolean()
161 .custom(isBooleanValid).withMessage('Should have a valid wait transcoding attribute'),
152 body('privacy') 162 body('privacy')
153 .optional() 163 .optional()
154 .toInt() 164 .toInt()