aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/feeds.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/feeds.ts')
-rw-r--r--server/middlewares/validators/feeds.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/middlewares/validators/feeds.ts b/server/middlewares/validators/feeds.ts
index 51e6d6fff..51b8fdd19 100644
--- a/server/middlewares/validators/feeds.ts
+++ b/server/middlewares/validators/feeds.ts
@@ -1,8 +1,9 @@
1import * as express from 'express' 1import * as express from 'express'
2import { param, query } from 'express-validator' 2import { param, query } from 'express-validator'
3
3import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' 4import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
4import { isValidRSSFeed } from '../../helpers/custom-validators/feeds' 5import { isValidRSSFeed } from '../../helpers/custom-validators/feeds'
5import { exists, isIdOrUUIDValid, isIdValid } from '../../helpers/custom-validators/misc' 6import { exists, isIdOrUUIDValid, isIdValid, toCompleteUUID } from '../../helpers/custom-validators/misc'
6import { logger } from '../../helpers/logger' 7import { logger } from '../../helpers/logger'
7import { 8import {
8 areValidationErrors, 9 areValidationErrors,
@@ -98,7 +99,10 @@ const videoSubscriptionFeedsValidator = [
98] 99]
99 100
100const videoCommentsFeedsValidator = [ 101const videoCommentsFeedsValidator = [
101 query('videoId').optional().custom(isIdOrUUIDValid), 102 query('videoId')
103 .customSanitizer(toCompleteUUID)
104 .optional()
105 .custom(isIdOrUUIDValid),
102 106
103 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 107 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
104 logger.debug('Checking feeds parameters', { parameters: req.query }) 108 logger.debug('Checking feeds parameters', { parameters: req.query })