rack 2.0.0.rc1 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rack might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/rack.rb +1 -1
- data/lib/rack/auth/abstract/request.rb +5 -1
- data/lib/rack/mock.rb +0 -1
- data/lib/rack/query_parser.rb +13 -2
- data/rack.gemspec +0 -2
- data/test/spec_auth_basic.rb +7 -0
- data/test/spec_utils.rb +12 -0
- metadata +5 -20
- data/test/cgi/lighttpd.errors +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4e9c67e795c425f3e8faa0d0fe8d48daba757e5
|
4
|
+
data.tar.gz: bf8c0c20c6310e7bd53e8b20c8c4946b1205eb65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5540bc2b6de513db3c5c494e6e32229087fb20040c4670a8c2215a9ea5a04b010ac9b5143cc3703ab73df0417234a416e49370fb3eafc85bde1c569e521c0612
|
7
|
+
data.tar.gz: f2af8aa5ee53427248393dd707ca34428d18b064c3081a3db663cd0f1e6f35e4b18ce54f607f7cea3c56569ef2552240dd55d0c4ff7006e0e2ab80db3800a933
|
data/lib/rack.rb
CHANGED
data/lib/rack/mock.rb
CHANGED
data/lib/rack/query_parser.rb
CHANGED
@@ -102,8 +102,7 @@ module Rack
|
|
102
102
|
child_key = $1
|
103
103
|
params[k] ||= []
|
104
104
|
raise ParameterTypeError, "expected Array (got #{params[k].class.name}) for param `#{k}'" unless params[k].is_a?(Array)
|
105
|
-
|
106
|
-
if params_hash_type?(params[k].last) && !params[k].last.key?(first_key)
|
105
|
+
if params_hash_type?(params[k].last) && !params_hash_has_key?(params[k].last, child_key)
|
107
106
|
normalize_params(params[k].last, child_key, v, depth - 1)
|
108
107
|
else
|
109
108
|
params[k] << normalize_params(make_params, child_key, v, depth - 1)
|
@@ -135,6 +134,18 @@ module Rack
|
|
135
134
|
obj.kind_of?(@params_class)
|
136
135
|
end
|
137
136
|
|
137
|
+
def params_hash_has_key?(hash, key)
|
138
|
+
return false if key =~ /\[\]/
|
139
|
+
|
140
|
+
key.split(/[\[\]]+/).inject(hash) do |h, part|
|
141
|
+
next h if part == ''
|
142
|
+
return false unless params_hash_type?(h) && h.key?(part)
|
143
|
+
h[part]
|
144
|
+
end
|
145
|
+
|
146
|
+
true
|
147
|
+
end
|
148
|
+
|
138
149
|
def unescape(s)
|
139
150
|
Utils.unescape(s)
|
140
151
|
end
|
data/rack.gemspec
CHANGED
@@ -28,8 +28,6 @@ EOF
|
|
28
28
|
s.homepage = 'http://rack.github.io/'
|
29
29
|
s.required_ruby_version = '>= 2.2.2'
|
30
30
|
|
31
|
-
s.add_dependency 'json'
|
32
|
-
|
33
31
|
s.add_development_dependency 'minitest', "~> 5.0"
|
34
32
|
s.add_development_dependency 'minitest-sprint'
|
35
33
|
s.add_development_dependency 'concurrent-ruby'
|
data/test/spec_auth_basic.rb
CHANGED
@@ -75,6 +75,13 @@ describe Rack::Auth::Basic do
|
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
+
it 'return 401 Bad Request for a nil authorization header' do
|
79
|
+
request 'HTTP_AUTHORIZATION' => nil do |response|
|
80
|
+
response.must_be :client_error?
|
81
|
+
response.status.must_equal 401
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
78
85
|
it 'takes realm as optional constructor arg' do
|
79
86
|
app = Rack::Auth::Basic.new(unprotected_app, realm) { true }
|
80
87
|
realm.must_equal app.realm
|
data/test/spec_utils.rb
CHANGED
@@ -231,6 +231,18 @@ describe Rack::Utils do
|
|
231
231
|
message.must_equal "invalid byte sequence in UTF-8"
|
232
232
|
end
|
233
233
|
|
234
|
+
it "only moves to a new array when the full key has been seen" do
|
235
|
+
Rack::Utils.parse_nested_query("x[][y][][z]=1&x[][y][][w]=2").
|
236
|
+
must_equal "x" => [{"y" => [{"z" => "1", "w" => "2"}]}]
|
237
|
+
|
238
|
+
Rack::Utils.parse_nested_query(
|
239
|
+
"x[][id]=1&x[][y][a]=5&x[][y][b]=7&x[][z][id]=3&x[][z][w]=0&x[][id]=2&x[][y][a]=6&x[][y][b]=8&x[][z][id]=4&x[][z][w]=0"
|
240
|
+
).must_equal "x" => [
|
241
|
+
{"id" => "1", "y" => {"a" => "5", "b" => "7"}, "z" => {"id" => "3", "w" => "0"}},
|
242
|
+
{"id" => "2", "y" => {"a" => "6", "b" => "8"}, "z" => {"id" => "4", "w" => "0"}},
|
243
|
+
]
|
244
|
+
end
|
245
|
+
|
234
246
|
it "allow setting the params hash class to use for parsing query strings" do
|
235
247
|
begin
|
236
248
|
default_parser = Rack::Utils.default_query_parser
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Neukirchen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: json
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: minitest
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -185,7 +171,6 @@ files:
|
|
185
171
|
- test/cgi/assets/javascripts/app.js
|
186
172
|
- test/cgi/assets/stylesheets/app.css
|
187
173
|
- test/cgi/lighttpd.conf
|
188
|
-
- test/cgi/lighttpd.errors
|
189
174
|
- test/cgi/rackup_stub.rb
|
190
175
|
- test/cgi/sample_rackup.ru
|
191
176
|
- test/cgi/test
|
@@ -298,12 +283,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
298
283
|
version: 2.2.2
|
299
284
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
300
285
|
requirements:
|
301
|
-
- - "
|
286
|
+
- - ">="
|
302
287
|
- !ruby/object:Gem::Version
|
303
|
-
version:
|
288
|
+
version: '0'
|
304
289
|
requirements: []
|
305
290
|
rubyforge_project:
|
306
|
-
rubygems_version: 2.6.
|
291
|
+
rubygems_version: 2.6.6
|
307
292
|
signing_key:
|
308
293
|
specification_version: 4
|
309
294
|
summary: a modular Ruby webserver interface
|
data/test/cgi/lighttpd.errors
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
2016-05-04 12:00:25: (log.c.164) server started
|
2
|
-
2016-05-04 12:00:35: (server.c.1558) server stopped by UID = 502 PID = 80374
|
3
|
-
2016-05-04 12:13:42: (log.c.164) server started
|
4
|
-
2016-05-04 12:13:51: (server.c.1558) server stopped by UID = 502 PID = 82209
|
5
|
-
2016-05-04 12:16:30: (log.c.164) server started
|
6
|
-
2016-05-04 12:16:39: (server.c.1558) server stopped by UID = 502 PID = 82523
|
7
|
-
2016-05-04 12:18:17: (log.c.164) server started
|
8
|
-
2016-05-04 12:18:26: (server.c.1558) server stopped by UID = 502 PID = 82745
|