rack-geoipcountry 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,7 +34,8 @@ module Rack
34
34
  end
35
35
 
36
36
  def call(env)
37
- result = @db.country(env['REMOTE_ADDR']).to_hash
37
+ request = Rack::Request.new(env)
38
+ result = @db.country(request.ip).to_hash
38
39
  env['X_GEOIP_COUNTRY_ID'] = result[:country_code]
39
40
  env['X_GEOIP_COUNTRY_CODE'] = result[:country_code2]
40
41
  env['X_GEOIP_COUNTRY_CODE3'] = result[:country_code3]
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module GeoIPCountry
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-geoipcountry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-03-29 00:00:00.000000000 Z
13
+ date: 2012-04-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: geoip