Commit 4af9851e authored by Adrien Béraud's avatar Adrien Béraud

nameservice: fix cache check

Change-Id: I521f2bf3370815ec572e4837c0ab237a156e4a31
parent a5bc40c4
......@@ -430,7 +430,7 @@ function startServer(result) {
http_res.status(400).end(JSON.stringify({"success": false, "error": "invalid name"}));
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"}));
return;
}
......@@ -454,7 +454,7 @@ function startServer(result) {
http_res.status(401).end(JSON.stringify({"success": false, "error": "signature verification failed"}));
return;
}
else{
else {
publickey = req.body.publickey;
signature = req.body.signature;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment