]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/logs.ts
Merge branch 'release/4.3.0' into develop
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / logs.ts
index ce36dc40b45fd8cebba1da1edcf3d79fa5f9f270..2d828bb429a9eb603118fe13621205b6fb7e94b2 100644 (file)
@@ -3,6 +3,7 @@ import { body, query } from 'express-validator'
 import { isUrlValid } from '@server/helpers/custom-validators/activitypub/misc'
 import { isStringArray } from '@server/helpers/custom-validators/search'
 import { CONFIG } from '@server/initializers/config'
+import { arrayify } from '@shared/core-utils'
 import { HttpStatusCode } from '@shared/models'
 import {
   isValidClientLogLevel,
@@ -12,8 +13,7 @@ import {
   isValidClientLogUserAgent,
   isValidLogLevel
 } from '../../helpers/custom-validators/logs'
-import { isDateValid, toArray } from '../../helpers/custom-validators/misc'
-import { logger } from '../../helpers/logger'
+import { isDateValid } from '../../helpers/custom-validators/misc'
 import { areValidationErrors } from './shared'
 
 const createClientLogValidator = [
@@ -39,8 +39,6 @@ const createClientLogValidator = [
     .custom(isValidClientLogUserAgent),
 
   (req: express.Request, res: express.Response, next: express.NextFunction) => {
-    logger.debug('Checking createClientLogValidator parameters.', { parameters: req.query })
-
     if (CONFIG.LOG.ACCEPT_CLIENT_LOG !== true) {
       return res.sendStatus(HttpStatusCode.FORBIDDEN_403)
     }
@@ -59,15 +57,13 @@ const getLogsValidator = [
     .custom(isValidLogLevel),
   query('tagsOneOf')
     .optional()
-    .customSanitizer(toArray)
+    .customSanitizer(arrayify)
     .custom(isStringArray).withMessage('Should have a valid one of tags array'),
   query('endDate')
     .optional()
     .custom(isDateValid).withMessage('Should have an end date that conforms to ISO 8601'),
 
   (req: express.Request, res: express.Response, next: express.NextFunction) => {
-    logger.debug('Checking getLogsValidator parameters.', { parameters: req.query })
-
     if (areValidationErrors(req, res)) return
 
     return next()
@@ -82,8 +78,6 @@ const getAuditLogsValidator = [
     .custom(isDateValid).withMessage('Should have a end date that conforms to ISO 8601'),
 
   (req: express.Request, res: express.Response, next: express.NextFunction) => {
-    logger.debug('Checking getAuditLogsValidator parameters.', { parameters: req.query })
-
     if (areValidationErrors(req, res)) return
 
     return next()