rack-entrance 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rack/entrance/version.rb +1 -1
- data/lib/rack/entrance.rb +4 -1
- data/spec/lib/rack/entrance_spec.rb +11 -0
- metadata +2 -2
data/lib/rack/entrance.rb
CHANGED
@@ -20,6 +20,17 @@ describe Rack::Entrance do
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
context 'internal request by prefix' do
|
24
|
+
before do
|
25
|
+
ENV['ENTRANCE_INTERNAL_IPS'] = '203.0.113.255,127.0.'
|
26
|
+
get '/'
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'sets internal to true' do
|
30
|
+
last_request.env['entrance.internal'].should be_true
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
23
34
|
context 'external request' do
|
24
35
|
before do
|
25
36
|
ENV['ENTRANCE_INTERNAL_IPS'] = '192.0.2.21,203.0.113.255'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-entrance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-11-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|