aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r--server/middlewares/validators/videos/videos.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts
index 4d31d3dcb..bb617d77c 100644
--- a/server/middlewares/validators/videos/videos.ts
+++ b/server/middlewares/validators/videos/videos.ts
@@ -20,7 +20,7 @@ import {
20 toIntOrNull, 20 toIntOrNull,
21 toValueOrNull 21 toValueOrNull
22} from '../../../helpers/custom-validators/misc' 22} from '../../../helpers/custom-validators/misc'
23import { isNSFWQueryValid, isNumberArray, isStringArray } from '../../../helpers/custom-validators/search' 23import { isBooleanBothQueryValid, isNumberArray, isStringArray } from '../../../helpers/custom-validators/search'
24import { checkUserCanTerminateOwnershipChange, doesChangeVideoOwnershipExist } from '../../../helpers/custom-validators/video-ownership' 24import { checkUserCanTerminateOwnershipChange, doesChangeVideoOwnershipExist } from '../../../helpers/custom-validators/video-ownership'
25import { 25import {
26 isScheduleVideoUpdatePrivacyValid, 26 isScheduleVideoUpdatePrivacyValid,
@@ -439,7 +439,11 @@ const commonVideosFiltersValidator = [
439 .custom(isStringArray).withMessage('Should have a valid all of tags array'), 439 .custom(isStringArray).withMessage('Should have a valid all of tags array'),
440 query('nsfw') 440 query('nsfw')
441 .optional() 441 .optional()
442 .custom(isNSFWQueryValid).withMessage('Should have a valid NSFW attribute'), 442 .custom(isBooleanBothQueryValid).withMessage('Should have a valid NSFW attribute'),
443 query('isLive')
444 .optional()
445 .customSanitizer(toBooleanOrNull)
446 .custom(isBooleanValid).withMessage('Should have a valid live boolean'),
443 query('filter') 447 query('filter')
444 .optional() 448 .optional()
445 .custom(isVideoFilterValid).withMessage('Should have a valid filter attribute'), 449 .custom(isVideoFilterValid).withMessage('Should have a valid filter attribute'),