geo_redirect 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module GeoRedirect
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
data/lib/geo_redirect.rb CHANGED
@@ -84,7 +84,7 @@ module GeoRedirect
84
84
  def handle_geoip
85
85
  # Fetch country code
86
86
  begin
87
- res = @db.country(@request.env['REMOTE_ADDR'])
87
+ res = @db.country(@request.env['HTTP_X_FORWARDED_FOR'] || @request.env['REMOTE_ADDR'])
88
88
  code = res.try(:country_code)
89
89
  country = res.try(:country_code2) unless code.nil? || code.zero?
90
90
  rescue
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geo_redirect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: