Skip to content

Commit

Permalink
add support for proxies that add X-Forwarded-For
Browse files Browse the repository at this point in the history
  • Loading branch information
davehorton committed Nov 5, 2021
1 parent 0b1b49b commit 8584020
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8584020

Please sign in to comment.