From b35833cadff3a4e9346cb97ae3628f6c5b4e6bf9 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Tue, 4 Jun 2024 03:17:10 +0300 Subject: Extra validation --- api/routes/getZblock/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api/routes/getZblock') diff --git a/api/routes/getZblock/index.js b/api/routes/getZblock/index.js index 723df48..57acae1 100644 --- a/api/routes/getZblock/index.js +++ b/api/routes/getZblock/index.js @@ -51,7 +51,7 @@ function fetchZblock(zblock, res){ module.exports = (req, res) => { console.log(req.params) - if ( (req.params.zblock) && req.params.zblock.length === 46 ){ + if ( (req.params.zblock) && typeof req.params.zblock === "string" && req.params.zblock.length === 46 ){ regex= /Qm[A-Za-z0-9]{44}/; if (regex.test(req.params.zblock)){ if (req.params.zblock === "QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH" ){ -- cgit v1.2.3