aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/logs.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-17 14:27:04 +0200
committerChocobozzz <me@florianbigard.com>2022-08-17 14:27:04 +0200
commit396f6f0140b0f76162e2378fd5a61e2f888673ed (patch)
treea5bd668bfc7dca7f311b9fc42ebb8bd01f462648 /server/middlewares/validators/logs.ts
parent97eba003a9d0adcb0cab9190f566327b1417c7d3 (diff)
downloadPeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.tar.gz
PeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.tar.zst
PeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.zip
Cleanup useless express validator messages
Diffstat (limited to 'server/middlewares/validators/logs.ts')
-rw-r--r--server/middlewares/validators/logs.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/server/middlewares/validators/logs.ts b/server/middlewares/validators/logs.ts
index 324ba6915..ce36dc40b 100644
--- a/server/middlewares/validators/logs.ts
+++ b/server/middlewares/validators/logs.ts
@@ -18,25 +18,25 @@ import { areValidationErrors } from './shared'
18 18
19const createClientLogValidator = [ 19const createClientLogValidator = [
20 body('message') 20 body('message')
21 .custom(isValidClientLogMessage).withMessage('Should have a valid log message'), 21 .custom(isValidClientLogMessage),
22 22
23 body('url') 23 body('url')
24 .custom(isUrlValid).withMessage('Should have a valid log url'), 24 .custom(isUrlValid),
25 25
26 body('level') 26 body('level')
27 .custom(isValidClientLogLevel).withMessage('Should have a valid log message'), 27 .custom(isValidClientLogLevel),
28 28
29 body('stackTrace') 29 body('stackTrace')
30 .optional() 30 .optional()
31 .custom(isValidClientLogStackTrace).withMessage('Should have a valid log stack trace'), 31 .custom(isValidClientLogStackTrace),
32 32
33 body('meta') 33 body('meta')
34 .optional() 34 .optional()
35 .custom(isValidClientLogMeta).withMessage('Should have a valid log meta'), 35 .custom(isValidClientLogMeta),
36 36
37 body('userAgent') 37 body('userAgent')
38 .optional() 38 .optional()
39 .custom(isValidClientLogUserAgent).withMessage('Should have a valid log user agent'), 39 .custom(isValidClientLogUserAgent),
40 40
41 (req: express.Request, res: express.Response, next: express.NextFunction) => { 41 (req: express.Request, res: express.Response, next: express.NextFunction) => {
42 logger.debug('Checking createClientLogValidator parameters.', { parameters: req.query }) 42 logger.debug('Checking createClientLogValidator parameters.', { parameters: req.query })
@@ -56,7 +56,7 @@ const getLogsValidator = [
56 .custom(isDateValid).withMessage('Should have a start date that conforms to ISO 8601'), 56 .custom(isDateValid).withMessage('Should have a start date that conforms to ISO 8601'),
57 query('level') 57 query('level')
58 .optional() 58 .optional()
59 .custom(isValidLogLevel).withMessage('Should have a valid level'), 59 .custom(isValidLogLevel),
60 query('tagsOneOf') 60 query('tagsOneOf')
61 .optional() 61 .optional()
62 .customSanitizer(toArray) 62 .customSanitizer(toArray)