add support for proxies that add X-Forwarded-For

This commit is contained in:
Dave Horton
2021-11-05 09:29:12 -04:00
parent 0b1b49bd59
commit 8584020d4c
+2 -2
View File
@@ -75,8 +75,8 @@ module.exports = function(srf, logger) {
req.locals = req.locals || {};
/* check if forwarded by a proxy that applied an X-Forwarded-For Header */
if (req.has('X-Subspace-Forwarded-For')) {
const original_source_address = req.get('X-Subspace-Forwarded-For');
if (req.has('X-Forwarded-For') || req.has('X-Subspace-Forwarded-For')) {
const original_source_address = req.get('X-Forwarded-For') || req.get('X-Subspace-Forwarded-For');
logger.info({
callId: req.get('Call-ID'),
original_source_address,