ping: Fixed usage of SimpleQuery.filter

master
Felix Stupp 6 years ago
parent da2ba3e313
commit 699e519dc1
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -9,7 +9,7 @@ router.use((req, res, next) => {
}); });
router.get("/:fqdn", (req, res) => { router.get("/:fqdn", (req, res) => {
db.q.select(["ipv4", "ipv6"]).from("addresses").where("fqdn", req.params.fqdn).first((e, d) => { db.q.select(["ipv4", "ipv6"]).from("addresses").filter("fqdn", req.params.fqdn).first((e, d) => {
if (e) return res.status(400).send("Error"); if (e) return res.status(400).send("Error");
if (!d) return res.status(404).send("Unknown FQDN"); if (!d) return res.status(404).send("Unknown FQDN");
res.send(d.ipv4 ? (d.ipv6 ? d.ipv4 + "\n" + d.ipv6 : d.ipv4) : (d.ipv6 ? d.ipv6 : "")); res.send(d.ipv4 ? (d.ipv6 ? d.ipv4 + "\n" + d.ipv6 : d.ipv4) : (d.ipv6 ? d.ipv6 : ""));

Loading…
Cancel
Save