req.connection.remoteAddress is deprecated

This commit is contained in:
Girish Ramakrishnan
2025-01-29 10:35:09 +01:00
parent b8c36b034b
commit 74f4849144
5 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ class AuditSource {
}
static fromRequest(req) {
const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress || null;
const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress || null;
return new AuditSource(req.user?.username, req.user?.id, ip);
}
@@ -18,7 +18,7 @@ class AuditSource {
}
static fromOidcRequest(req) {
const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress || null;
const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress || null;
return new AuditSource('oidc', req.body?.username, ip);
}
}