From da2ba3e313a7222d82a09669f4ffe52e78a98c14 Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Sat, 29 Dec 2018 18:47:26 +0100 Subject: [PATCH] ping: Fixed error message on invalid ip address --- routes/ping.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/ping.js b/routes/ping.js index 33918a6..dea80c2 100644 --- a/routes/ping.js +++ b/routes/ping.js @@ -18,7 +18,7 @@ router.get("/:fqdn", (req, res) => { router.get("/:fqdn/:code", (req, res) => { let addr = ipaddr.parse(req.ip); - if (!["ipv4", "ipv6"].includes(addr.kind())) return res.status(400).send("Invalid protocoll"); + if (!["ipv4", "ipv6"].includes(addr.kind())) return res.status(400).send("Invalid ip address"); db.query("UDPATE addresses SET " + addr.kind() + " = ? WHERE fqdn = ? AND code = ?", [addr.toString(), req.params.fqdn, req.params.code], (e, d) => { if (e) return res.status(400).send("Error"); res.send(d);