Skip to content

Instantly share code, notes, and snippets.

@freshlogic
Created July 26, 2014 01:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freshlogic/39997d2e843f6a261b18 to your computer and use it in GitHub Desktop.
Save freshlogic/39997d2e843f6a261b18 to your computer and use it in GitHub Desktop.
xForwardedFor.js
exports.xForwardedFor = function(req, res, next) {
if (!req.headers['x-forwarded-for']) {
if (req.headers['x-iis-node-remote_addr']) {
req.headers['x-forwarded-for'] = req.headers['x-iis-node-remote_addr'];
}
}
next();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment