diff --git a/lib/geocoder/request.rb b/lib/geocoder/request.rb index fe8286b58c559f7d4b1bf8584cb796a3e4234f5f..3e1dbc823a7d7d769a289f5dbed9adeadb982e07 100644 --- a/lib/geocoder/request.rb +++ b/lib/geocoder/request.rb @@ -7,6 +7,8 @@ module Geocoder unless defined?(@location) 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 else @location = Geocoder.search(ip).first end