x-real-ip 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9abd97215758734d01c9dcb41389e7f7b20e2cae
4
- data.tar.gz: 5d7e1c3a1a9de4d3a6c865cff2634e10a8ce621e
3
+ metadata.gz: d7df2ede64048c2ec30a62a05ff96c26c49adb92
4
+ data.tar.gz: f376fd3dffbc5c0488b926cff92cb6aa9a8d6355
5
5
  SHA512:
6
- metadata.gz: 0d194d560ff61d44b136b91aa16dd0661865d19a33e5090dddeb284240f1a9a9775d80d22d66a37d3127dc5b4a9754e5eeb0433fc5ab5b2bb958346104e3942f
7
- data.tar.gz: 7badc8d919900b7bf2b5443961056988dd275963a66e4fbd03c2f63d51583159ef3ce4f912993ccf6dbf0842acddfd2df717698ac261826d67b5abd797534858
6
+ metadata.gz: 07a95514defa03eefd56548bcbacc03b4304a79c08b22ba81df2c7e64b3464b43fec544194e81ae5161b1985d3719cfb16b801df0ca39abcb82a50e32622b11a
7
+ data.tar.gz: 8a450481deb313fb77c850f080478bde65861b9b9129bd2aa90d35013902ee6c3abe57459bbae60bf475bc8051866093fcec8349e498dffc6b8102d7819ae09c
@@ -16,6 +16,9 @@ module XRealIp
16
16
  def call(env)
17
17
  real_ips = env["HTTP_X_REAL_IP"]
18
18
  if real_ips
19
+ # for Rails logger
20
+ env["HTTP_X_FORWARDED_FOR"] = real_ips
21
+
19
22
  proxies = []
20
23
  list = real_ips.split(',')
21
24
  return @app.call(env) if list.empty?
@@ -1,7 +1,7 @@
1
1
  module XRealIp
2
2
  class Railtie < Rails::Railtie
3
3
  initializer "railtie.configure_rails_initialization" do |app|
4
- app.config.middleware.use XRealIp::Middleware
4
+ app.config.middleware.insert_before Rack::Runtime, XRealIp::Middleware
5
5
  end
6
6
  end
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module XRealIp
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: x-real-ip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - 55ideas