Skip to content

Commit

Permalink
Merge pull request #4 from morello-cl/fix-ip-forwarder
Browse files Browse the repository at this point in the history
fix bug X-Forwarder-For
  • Loading branch information
pbojinov committed Dec 2, 2014
2 parents e1f9032 + fae6426 commit 1ed5d8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @method getClientIp
*
* Get client IP address
*
*
* Will return 127.0.0.1 when testing locally
* Useful when you need the user ip for geolocation or serving localized content
*
Expand All @@ -17,7 +17,7 @@
function getClientIp(req) {
var ipAddress;
// Amazon EC2 / Heroku workaround to get real client IP
var forwardedIpsStr = req.header('X-Forwarded-For'),
var forwardedIpsStr = req.header('X-Forwarder-For'),
clientIp = req.header('X-Client-IP');

if (clientIp) {
Expand All @@ -41,4 +41,4 @@ function getClientIp(req) {
/**
* Expose mode public functions
*/
exports.getClientIp = getClientIp;
exports.getClientIp = getClientIp;

0 comments on commit 1ed5d8d

Please sign in to comment.