From d881fe9a3abbb009aff2ea50d50dfdcdc5355804 Mon Sep 17 00:00:00 2001 From: Lahiru Kurukulasuriya Date: Thu, 18 Mar 2021 22:10:47 +0800 Subject: [PATCH] fix: correct min and max validation of limit param --- server/routes/tokenRouter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/routes/tokenRouter.js b/server/routes/tokenRouter.js index 676b1378..9bbc1fbb 100644 --- a/server/routes/tokenRouter.js +++ b/server/routes/tokenRouter.js @@ -42,7 +42,7 @@ tokenRouter.get('/', Joi.assert( req.query, Joi.object({ - limit: Joi.number().required(), + limit: Joi.number().min(0).max(1000).required(), start: Joi.number().min(1).max(10000).integer(), wallet: Joi.string(), }) @@ -85,7 +85,7 @@ tokenRouter.get('/:id/transactions', Joi.assert( req.query, Joi.object({ - limit: Joi.number().required(), + limit: Joi.number().min(0).max(1000).required(), start: Joi.number().min(1).max(10000).integer(), id: Joi.string().guid(), transactions: Joi.string(),