aboutsummaryrefslogtreecommitdiff
path: root/api/routes/announceZChain/index.js
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-06-04 03:30:10 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-06-04 03:30:10 +0300
commit40206d2ede1c9963c4e4f718e1e203e5d901af73 (patch)
tree06f185de3bf8ca6b903b85e184c30e64afc75e75 /api/routes/announceZChain/index.js
parentb35833cadff3a4e9346cb97ae3628f6c5b4e6bf9 (diff)
downloadarching-kaos-tools-40206d2ede1c9963c4e4f718e1e203e5d901af73.tar.gz
arching-kaos-tools-40206d2ede1c9963c4e4f718e1e203e5d901af73.tar.bz2
arching-kaos-tools-40206d2ede1c9963c4e4f718e1e203e5d901af73.zip
Extra validation
Diffstat (limited to 'api/routes/announceZChain/index.js')
-rw-r--r--api/routes/announceZChain/index.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/api/routes/announceZChain/index.js b/api/routes/announceZChain/index.js
index 092b6a9..91ac5b9 100644
--- a/api/routes/announceZChain/index.js
+++ b/api/routes/announceZChain/index.js
@@ -36,10 +36,11 @@ const getNSvalidity = require('../../validators/ZchainValidator')
module.exports = (req, res) => {
console.log(req);
- if ( (req.body.zchain) && req.body.zchain.length === 62 ){//&& req.body.block_signature.length === 46){
+ if ( (req.body.zchain) && typeof req.body.zchain === "string" && req.body.zchain.length === 62 ){
+ let zchain = req.body.zchain;
regex= /k51qzi5uqu5d[A-Za-z0-9]{50}/
- if (regex.test(req.body.zchain)){ // && regex.test(req.body.block_signature)){
- getNSvalidity(req.body.zchain,res);
+ if (regex.test(zchain)){
+ getNSvalidity(zchain,res);
} else {
res.send({error:"Invalid data"});
}