From 4e1ae2b1971d16703d5b0ca353f1f1df3e273a3b Mon Sep 17 00:00:00 2001 From: Rob Di Marco <rob.dimarco@416software.com> Date: Thu, 3 Jan 2013 14:48:57 -0500 Subject: [PATCH] parse out as HTTP_X_FORWARDED_FOR as a comma separated list and ignore proxies --- lib/geocoder/request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/geocoder/request.rb b/lib/geocoder/request.rb index 3e1dbc82..f02aab47 100644 --- a/lib/geocoder/request.rb +++ b/lib/geocoder/request.rb @@ -8,7 +8,7 @@ module Geocoder if env.has_key?('HTTP_X_REAL_IP') @location = Geocoder.search(env['HTTP_X_REAL_IP']).first elsif env.has_key?('HTTP_X_FORWARDED_FOR') - @location = Geocoder.search(env['HTTP_X_FORWARDED_FOR']).first + @location = Geocoder.search(env['HTTP_X_FORWARDED_FOR'].split(/\s*,\s*/)[0]).first else @location = Geocoder.search(ip).first end -- GitLab