x-real-ip 0.0.1 → 0.1.0

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: b561d1e4fa4fdd9c722ece5e7ce58558e58eb2b9
4
- data.tar.gz: 637b074b29879b157c8e01ac4faf57378a5b3639
3
+ metadata.gz: 9abd97215758734d01c9dcb41389e7f7b20e2cae
4
+ data.tar.gz: 5d7e1c3a1a9de4d3a6c865cff2634e10a8ce621e
5
5
  SHA512:
6
- metadata.gz: a2827351dd92c5d2c1207d3f8ab30a13d20c1bdb7347315e2215c92f4f948c013c5e2f080eb13b8ddef492d5fb384062709b370ad2079700bfbfe0b04d249f52
7
- data.tar.gz: 3789046ff9da42656a33f4195beacd21d3c72acee0396f73ee370cb27a793d931bf13a0e37fd088e413d045d0a85dff2ecc062cf84c978a704ce65290baa0256
6
+ metadata.gz: 0d194d560ff61d44b136b91aa16dd0661865d19a33e5090dddeb284240f1a9a9775d80d22d66a37d3127dc5b4a9754e5eeb0433fc5ab5b2bb958346104e3942f
7
+ data.tar.gz: 7badc8d919900b7bf2b5443961056988dd275963a66e4fbd03c2f63d51583159ef3ce4f912993ccf6dbf0842acddfd2df717698ac261826d67b5abd797534858
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # X::Real::Ip
1
+ # X-Real-IP
2
2
 
3
3
  Replace REMOTE_IP with X-Real-Ip if it's trusted (useful for Nginx)
4
4
 
@@ -16,10 +16,10 @@ module XRealIp
16
16
  def call(env)
17
17
  real_ips = env["HTTP_X_REAL_IP"]
18
18
  if real_ips
19
+ proxies = []
20
+ list = real_ips.split(',')
21
+ return @app.call(env) if list.empty?
19
22
  begin
20
- proxies = []
21
- list = real_ips.split(',')
22
- return @app.call(env) if list.empty?
23
23
  list.push env["REMOTE_ADDR"]
24
24
  while tmp = list.pop
25
25
  addr = tmp
@@ -38,16 +38,12 @@ module XRealIp
38
38
  env["rack.url_scheme"] = 'https'
39
39
  end
40
40
  end
41
-
42
- @app.call(env)
43
41
  rescue => e
44
42
  $stderr.puts "Error in x-real-ip: #{$!}"
45
43
  $stderr.puts "Backtrace:\n\t#{e.backtrace.join("\n\t")}"
46
- @app.call(env)
47
44
  end
48
- else
49
- @app.call(env)
50
45
  end
46
+ @app.call(env)
51
47
  end
52
48
  end
53
49
  end
@@ -1,3 +1,3 @@
1
1
  module XRealIp
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: x-real-ip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - 55ideas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-25 00:00:00.000000000 Z
11
+ date: 2013-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rpatricia