From 8f5f4a30da8f3226ff5337d1da8f76f7eed08034 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Tue, 4 Jun 2024 16:44:28 +0300 Subject: Path traversal fix test --- api/routes/getMrk/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'api/routes/getMrk/index.js') diff --git a/api/routes/getMrk/index.js b/api/routes/getMrk/index.js index 097f1f0..6cc61b8 100644 --- a/api/routes/getMrk/index.js +++ b/api/routes/getMrk/index.js @@ -49,10 +49,11 @@ module.exports = (req, res) => { if ( (req.params.mrk) && req.params.mrk.length === 128 ){ regex= /[a-f0-9]{128}/; if (regex.test(req.params.mrk)){ - if (req.params.mrk === "QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH" ){ + let mrk = req.params.mrk; + if (mrk === "QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH" ){ res.send({error:"Genesis block"}); } else { - fetchFmrk(req.params.mrk,res); + fetchFmrk(mrk,res); } } else { res.send({error:"Invalid data: regexp failed to pass"}); -- cgit v1.2.3