fix: send back user IP address, not website address

This commit is contained in:
Manish 2023-03-28 03:17:34 +11:00
parent 283866ce16
commit 323f6abf59

View File

@ -22,7 +22,7 @@ app.get("/", function (req, res) {
// your first API endpoint... // your first API endpoint...
app.get("/api/whoami", (req, res) => { app.get("/api/whoami", (req, res) => {
res.json({ res.json({
ipaddress: req.headers.host, ipaddress: req.ip,
language: req.headers["accept-language"], language: req.headers["accept-language"],
software: req.headers["user-agent"], software: req.headers["user-agent"],
}); });