vault-tools 0.5.14 → 0.5.15
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/vault-tools/version.rb +1 -1
- data/lib/vault-tools/web.rb +9 -1
- data/test/web_test.rb +3 -0
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/lib/vault-tools/version.rb
CHANGED
data/lib/vault-tools/web.rb
CHANGED
@@ -19,7 +19,15 @@ module Vault
|
|
19
19
|
define_method "#{meth}_unprotected".to_sym do |path, opts = {}, &block|
|
20
20
|
pattern = compile!(meth.upcase, path, block, opts).first
|
21
21
|
set :unprotected_paths, settings.unprotected_paths + [pattern]
|
22
|
-
|
22
|
+
if meth.downcase == 'get'
|
23
|
+
conditions = @conditions.dup
|
24
|
+
route 'GET', path, opts, &block
|
25
|
+
|
26
|
+
@conditions = conditions
|
27
|
+
route 'HEAD', path, opts, &block
|
28
|
+
else
|
29
|
+
route meth.upcase, path, opts, &block
|
30
|
+
end
|
23
31
|
end
|
24
32
|
end
|
25
33
|
end
|
data/test/web_test.rb
CHANGED
@@ -97,6 +97,9 @@ class WebTest < Vault::TestCase
|
|
97
97
|
get '/protected'
|
98
98
|
assert_equal 401, last_response.status
|
99
99
|
|
100
|
+
head '/unprotected/Bob'
|
101
|
+
assert_equal 200, last_response.status
|
102
|
+
|
100
103
|
get '/unprotected/Bob'
|
101
104
|
assert_equal 200, last_response.status
|
102
105
|
assert_equal 'You may pass Bob', last_response.body
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vault-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.15
|
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: 2014-11-
|
13
|
+
date: 2014-11-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: scrolls
|