X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fmetrics.ts;h=cd6f872daa4000d6194d49c32b26875bdd5721ef;hb=396f6f0140b0f76162e2378fd5a61e2f888673ed;hp=b1dbec603c89ee8f3f85bb0020d904e18d2c8732;hpb=97eba003a9d0adcb0cab9190f566327b1417c7d3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/metrics.ts b/server/middlewares/validators/metrics.ts index b1dbec603..cd6f872da 100644 --- a/server/middlewares/validators/metrics.ts +++ b/server/middlewares/validators/metrics.ts @@ -9,30 +9,29 @@ import { areValidationErrors, doesVideoExist } from './shared' const addPlaybackMetricValidator = [ body('resolution') - .isInt({ min: 0 }).withMessage('Invalid resolution'), + .isInt({ min: 0 }), body('fps') .optional() - .isInt({ min: 0 }).withMessage('Invalid fps'), + .isInt({ min: 0 }), body('playerMode') - .custom(isValidPlayerMode).withMessage('Invalid playerMode'), + .custom(isValidPlayerMode), body('resolutionChanges') - .isInt({ min: 0 }).withMessage('Invalid resolutionChanges'), + .isInt({ min: 0 }), body('errors') - .isInt({ min: 0 }).withMessage('Invalid errors'), + .isInt({ min: 0 }), body('downloadedBytesP2P') - .isInt({ min: 0 }).withMessage('Invalid downloadedBytesP2P'), + .isInt({ min: 0 }), body('downloadedBytesHTTP') - .isInt({ min: 0 }).withMessage('Invalid downloadedBytesHTTP'), + .isInt({ min: 0 }), body('uploadedBytesP2P') - .isInt({ min: 0 }).withMessage('Invalid uploadedBytesP2P'), + .isInt({ min: 0 }), body('videoId') .customSanitizer(toCompleteUUID) - .optional() .custom(isIdOrUUIDValid), async (req: express.Request, res: express.Response, next: express.NextFunction) => {