ping: Changed status code for invalid token to 403

master
Felix Stupp 5 years ago
parent 9af27ac110
commit 4d2266e8a7
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -47,7 +47,7 @@ router.get("/:fqdn/:code", testIP, (req, res) => {
let addr = req.params.addr;
db.query("UPDATE addresses SET " + addr.kind() + " = ?, " + addr.kind() + "LastPing = CURRENT_TIMESTAMP WHERE fqdn = ? AND code = ?", [addr.toString(), req.params.fqdn, req.params.code], (e, d) => {
if (e) return res.status(400).send("Error");
if (d.affectedRows <= 0) return res.status(400).send("Invalid token");
if (d.affectedRows <= 0) return res.status(403).send("Invalid token");
res.send(addr.toString());
});
});

Loading…
Cancel
Save