added agent to server metrics (#1321)

This commit is contained in:
Danny Coates 2019-05-03 09:25:12 -07:00 committed by Donovan Preston
parent 19ac0480ee
commit f603f40f43
8 changed files with 15 additions and 5 deletions

View file

@ -13,7 +13,8 @@ module.exports = async function(req, res) {
ip: req.ip,
owner: meta.owner,
download_count: meta.dl,
ttl
ttl,
agent: req.ua.browser.name || req.ua.ua.substring(0, 6)
});
} catch (e) {
res.sendStatus(404);

View file

@ -28,7 +28,8 @@ module.exports = async function(req, res) {
ip: req.ip,
owner: meta.owner,
download_count: dl,
ttl
ttl,
agent: req.ua.browser.name || req.ua.ua.substring(0, 6)
});
try {
if (dl >= dlimit) {

View file

@ -114,7 +114,8 @@ module.exports = function(ws, req) {
dlimit,
timeLimit,
anonymous: !user,
size: limiter.length
size: limiter.length,
agent: req.ua.browser.name || req.ua.ua.substring(0, 6)
});
}
} catch (e) {