Skip to content
Snippets Groups Projects
Commit 4af9851e authored by Adrien Béraud's avatar Adrien Béraud
Browse files

nameservice: fix cache check

Change-Id: I521f2bf3370815ec572e4837c0ab237a156e4a31
parent a5bc40c4
No related branches found
No related tags found
No related merge requests found
...@@ -430,7 +430,7 @@ function startServer(result) { ...@@ -430,7 +430,7 @@ function startServer(result) {
http_res.status(400).end(JSON.stringify({"success": false, "error": "invalid name"})); http_res.status(400).end(JSON.stringify({"success": false, "error": "invalid name"}));
return; return;
} }
if(cache[req.params.name] == undefined){ if (req.params.name in cache) {
http_res.status(400).end(JSON.stringify({"success":false,"error": "name already registered"})); http_res.status(400).end(JSON.stringify({"success":false,"error": "name already registered"}));
return; return;
} }
...@@ -454,7 +454,7 @@ function startServer(result) { ...@@ -454,7 +454,7 @@ function startServer(result) {
http_res.status(401).end(JSON.stringify({"success": false, "error": "signature verification failed"})); http_res.status(401).end(JSON.stringify({"success": false, "error": "signature verification failed"}));
return; return;
} }
else{ else {
publickey = req.body.publickey; publickey = req.body.publickey;
signature = req.body.signature; signature = req.body.signature;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment