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 +4 -4
- data/README.md +1 -1
- data/lib/x-real-ip/middleware.rb +4 -8
- data/lib/x-real-ip/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9abd97215758734d01c9dcb41389e7f7b20e2cae
|
4
|
+
data.tar.gz: 5d7e1c3a1a9de4d3a6c865cff2634e10a8ce621e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d194d560ff61d44b136b91aa16dd0661865d19a33e5090dddeb284240f1a9a9775d80d22d66a37d3127dc5b4a9754e5eeb0433fc5ab5b2bb958346104e3942f
|
7
|
+
data.tar.gz: 7badc8d919900b7bf2b5443961056988dd275963a66e4fbd03c2f63d51583159ef3ce4f912993ccf6dbf0842acddfd2df717698ac261826d67b5abd797534858
|
data/README.md
CHANGED
data/lib/x-real-ip/middleware.rb
CHANGED
@@ -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
|
data/lib/x-real-ip/version.rb
CHANGED
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
|
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-
|
11
|
+
date: 2013-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rpatricia
|