|
|
|
@ -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());
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|