mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-12 23:20:25 +08:00
added ip and useragent logging
This commit is contained in:
parent
05c639117b
commit
a9a9afa2e4
1 changed files with 12 additions and 1 deletions
|
@ -113,7 +113,18 @@ class UserController {
|
|||
);
|
||||
}
|
||||
}
|
||||
Logger.log("user_data_requested", ``, uid);
|
||||
Logger.log(
|
||||
"user_data_requested",
|
||||
{
|
||||
ip:
|
||||
req.headers["cf-connecting-ip"] ||
|
||||
req.headers["x-forwarded-for"] ||
|
||||
req.ip ||
|
||||
"255.255.255.255",
|
||||
userAgent: req.headers["user-agent"],
|
||||
},
|
||||
uid
|
||||
);
|
||||
return res.status(200).json(userInfo);
|
||||
} catch (e) {
|
||||
return next(e);
|
||||
|
|
Loading…
Reference in a new issue