From 3736241cb07eb47c7ceed5fc38cb43633bb0ab4c Mon Sep 17 00:00:00 2001 From: kaotisk Date: Fri, 14 Jun 2024 07:15:52 +0300 Subject: Refactoring --- api/routes/announceZChain/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'api/routes/announceZChain') diff --git a/api/routes/announceZChain/index.js b/api/routes/announceZChain/index.js index a1b336c..0261aa4 100644 --- a/api/routes/announceZChain/index.js +++ b/api/routes/announceZChain/index.js @@ -22,9 +22,11 @@ module.exports = (req, res) => { if (regex.test(zchain)){ getNSvalidity(zchain,res); } else { - res.send({error:"Invalid data"}); + res.writeHead(404, { 'Content-Type': 'application/json'}); + res.end(JSON.stringify({error:"Invalid data"})); } } else { - res.send({error:"Invalid data"}); + res.writeHead(404, { 'Content-Type': 'application/json'}); + res.end(JSON.stringify({error:"Invalid data"})); } } -- cgit v1.2.3