rack 1.5.0.beta.1 → 1.5.0.beta.2
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.
- data/README.rdoc +10 -0
- data/Rakefile +1 -1
- data/lib/rack/auth/abstract/request.rb +1 -1
- data/lib/rack/auth/basic.rb +1 -1
- data/lib/rack/auth/digest/request.rb +1 -1
- data/rack.gemspec +1 -1
- data/test/spec_mime.rb +18 -18
- data/test/spec_response.rb +3 -3
- data/test/spec_server.rb +2 -2
- data/test/spec_utils.rb +5 -5
- metadata +67 -55
data/README.rdoc
CHANGED
@@ -478,11 +478,21 @@ run on port 11211) and memcache-client installed.
|
|
478
478
|
* January 7th, 2013: Thirty first public release 1.4.3
|
479
479
|
* Security: Prevent unbounded reads in large multipart boundaries
|
480
480
|
|
481
|
+
* January 13th, 2013: Thirty second public release 1.4.4, 1.3.9, 1.2.7, 1.1.5
|
482
|
+
* [SEC] Rack::Auth::AbstractRequest no longer symbolizes arbitrary strings
|
483
|
+
* Fixed erroneous test case in the 1.3.x series
|
484
|
+
|
481
485
|
== Contact
|
482
486
|
|
483
487
|
Please post bugs, suggestions and patches to
|
484
488
|
the bug tracker at <http://github.com/rack/rack/issues>.
|
485
489
|
|
490
|
+
Please post security related bugs and suggestions to the core team at
|
491
|
+
<https://groups.google.com/group/rack-core> or rack-core@googlegroups.com. This
|
492
|
+
list is not public. Due to wide usage of the library, it is strongly preferred
|
493
|
+
that we manage timing in order to provide viable patches at the time of
|
494
|
+
disclosure. Your assistance in this matter is greatly appreciated.
|
495
|
+
|
486
496
|
Mailing list archives are available at
|
487
497
|
<http://groups.google.com/group/rack-devel>.
|
488
498
|
|
data/Rakefile
CHANGED
@@ -85,7 +85,7 @@ task :test => 'SPEC' do
|
|
85
85
|
specopts = ENV['TESTOPTS'] ||
|
86
86
|
"-q -t '^(?!Rack::Adapter|Rack::Session::Memcache|Rack::Server|Rack::Handler)'"
|
87
87
|
|
88
|
-
sh "bacon -I./lib:./test #{opts} #{specopts}"
|
88
|
+
sh "bacon -w -I./lib:./test #{opts} #{specopts}"
|
89
89
|
end
|
90
90
|
|
91
91
|
desc "Run all the tests we run on CI"
|
data/lib/rack/auth/basic.rb
CHANGED
data/rack.gemspec
CHANGED
data/test/spec_mime.rb
CHANGED
@@ -4,47 +4,47 @@ describe Rack::Mime do
|
|
4
4
|
|
5
5
|
it "should return the fallback mime-type for files with no extension" do
|
6
6
|
fallback = 'image/jpg'
|
7
|
-
Rack::Mime.mime_type(File.extname('no_ext'), fallback).should
|
7
|
+
Rack::Mime.mime_type(File.extname('no_ext'), fallback).should.equal fallback
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should always return 'application/octet-stream' for unknown file extensions" do
|
11
11
|
unknown_ext = File.extname('unknown_ext.abcdefg')
|
12
|
-
Rack::Mime.mime_type(unknown_ext).should
|
12
|
+
Rack::Mime.mime_type(unknown_ext).should.equal 'application/octet-stream'
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should return the mime-type for a given extension" do
|
16
16
|
# sanity check. it would be infeasible test every single mime-type.
|
17
|
-
Rack::Mime.mime_type(File.extname('image.jpg')).should
|
17
|
+
Rack::Mime.mime_type(File.extname('image.jpg')).should.equal 'image/jpeg'
|
18
18
|
end
|
19
19
|
|
20
20
|
it "should support null fallbacks" do
|
21
|
-
Rack::Mime.mime_type('.nothing', nil).should
|
21
|
+
Rack::Mime.mime_type('.nothing', nil).should.equal nil
|
22
22
|
end
|
23
23
|
|
24
24
|
it "should match exact mimes" do
|
25
|
-
Rack::Mime.match?('text/html', 'text/html').should
|
26
|
-
Rack::Mime.match?('text/html', 'text/meme').should
|
27
|
-
Rack::Mime.match?('text', 'text').should
|
28
|
-
Rack::Mime.match?('text', 'binary').should
|
25
|
+
Rack::Mime.match?('text/html', 'text/html').should.equal true
|
26
|
+
Rack::Mime.match?('text/html', 'text/meme').should.equal false
|
27
|
+
Rack::Mime.match?('text', 'text').should.equal true
|
28
|
+
Rack::Mime.match?('text', 'binary').should.equal false
|
29
29
|
end
|
30
30
|
|
31
31
|
it "should match class wildcard mimes" do
|
32
|
-
Rack::Mime.match?('text/html', 'text/*').should
|
33
|
-
Rack::Mime.match?('text/plain', 'text/*').should
|
34
|
-
Rack::Mime.match?('application/json', 'text/*').should
|
35
|
-
Rack::Mime.match?('text/html', 'text').should
|
32
|
+
Rack::Mime.match?('text/html', 'text/*').should.equal true
|
33
|
+
Rack::Mime.match?('text/plain', 'text/*').should.equal true
|
34
|
+
Rack::Mime.match?('application/json', 'text/*').should.equal false
|
35
|
+
Rack::Mime.match?('text/html', 'text').should.equal true
|
36
36
|
end
|
37
37
|
|
38
38
|
it "should match full wildcards" do
|
39
|
-
Rack::Mime.match?('text/html', '*').should
|
40
|
-
Rack::Mime.match?('text/plain', '*').should
|
41
|
-
Rack::Mime.match?('text/html', '*/*').should
|
42
|
-
Rack::Mime.match?('text/plain', '*/*').should
|
39
|
+
Rack::Mime.match?('text/html', '*').should.equal true
|
40
|
+
Rack::Mime.match?('text/plain', '*').should.equal true
|
41
|
+
Rack::Mime.match?('text/html', '*/*').should.equal true
|
42
|
+
Rack::Mime.match?('text/plain', '*/*').should.equal true
|
43
43
|
end
|
44
44
|
|
45
45
|
it "should match type wildcard mimes" do
|
46
|
-
Rack::Mime.match?('text/html', '*/html').should
|
47
|
-
Rack::Mime.match?('text/plain', '*/plain').should
|
46
|
+
Rack::Mime.match?('text/html', '*/html').should.equal true
|
47
|
+
Rack::Mime.match?('text/plain', '*/plain').should.equal true
|
48
48
|
end
|
49
49
|
|
50
50
|
end
|
data/test/spec_response.rb
CHANGED
@@ -290,19 +290,19 @@ describe Rack::Response do
|
|
290
290
|
res.status = 204
|
291
291
|
_, _, b = res.finish
|
292
292
|
res.body.should.be.closed
|
293
|
-
b.should.not
|
293
|
+
b.should.not.equal res.body
|
294
294
|
|
295
295
|
res.body = StringIO.new
|
296
296
|
res.status = 205
|
297
297
|
_, _, b = res.finish
|
298
298
|
res.body.should.be.closed
|
299
|
-
b.should.not
|
299
|
+
b.should.not.equal res.body
|
300
300
|
|
301
301
|
res.body = StringIO.new
|
302
302
|
res.status = 304
|
303
303
|
_, _, b = res.finish
|
304
304
|
res.body.should.be.closed
|
305
|
-
b.should.not
|
305
|
+
b.should.not.equal res.body
|
306
306
|
end
|
307
307
|
|
308
308
|
it "wraps the body from #to_ary to prevent infinite loops" do
|
data/test/spec_server.rb
CHANGED
@@ -19,12 +19,12 @@ describe Rack::Server do
|
|
19
19
|
|
20
20
|
it "overrides :config if :app is passed in" do
|
21
21
|
server = Rack::Server.new(:app => "FOO")
|
22
|
-
server.app.should
|
22
|
+
server.app.should.equal "FOO"
|
23
23
|
end
|
24
24
|
|
25
25
|
should "prefer to use :builder when it is passed in" do
|
26
26
|
server = Rack::Server.new(:builder => "run lambda { |env| [200, {'Content-Type' => 'text/plain'}, ['success']] }")
|
27
|
-
server.app.class.should
|
27
|
+
server.app.class.should.equal Proc
|
28
28
|
Rack::MockRequest.new(server.app).get("/").body.to_s.should.equal 'success'
|
29
29
|
end
|
30
30
|
|
data/test/spec_utils.rb
CHANGED
@@ -282,17 +282,17 @@ describe Rack::Utils do
|
|
282
282
|
end
|
283
283
|
|
284
284
|
should "select best quality match" do
|
285
|
-
Rack::Utils.best_q_match("text/html", %w[text/html]).should
|
285
|
+
Rack::Utils.best_q_match("text/html", %w[text/html]).should.equal "text/html"
|
286
286
|
|
287
287
|
# More specific matches are preferred
|
288
|
-
Rack::Utils.best_q_match("text/*;q=0.5,text/html;q=1.0", %w[text/html]).should
|
288
|
+
Rack::Utils.best_q_match("text/*;q=0.5,text/html;q=1.0", %w[text/html]).should.equal "text/html"
|
289
289
|
|
290
290
|
# Higher quality matches are preferred
|
291
|
-
Rack::Utils.best_q_match("text/*;q=0.5,text/plain;q=1.0", %w[text/plain text/html]).should
|
291
|
+
Rack::Utils.best_q_match("text/*;q=0.5,text/plain;q=1.0", %w[text/plain text/html]).should.equal "text/plain"
|
292
292
|
|
293
293
|
# All else equal, the available mimes are preferred in order
|
294
|
-
Rack::Utils.best_q_match("text/*", %w[text/html text/plain]).should
|
295
|
-
Rack::Utils.best_q_match("text/plain,text/html", %w[text/html text/plain]).should
|
294
|
+
Rack::Utils.best_q_match("text/*", %w[text/html text/plain]).should.equal "text/html"
|
295
|
+
Rack::Utils.best_q_match("text/plain,text/html", %w[text/html text/plain]).should.equal "text/html"
|
296
296
|
end
|
297
297
|
|
298
298
|
should "escape html entities [&><'\"/]" do
|
metadata
CHANGED
@@ -1,70 +1,70 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 2837564799
|
5
5
|
prerelease: 6
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 5
|
9
|
+
- 0
|
10
|
+
- beta
|
11
|
+
- 2
|
12
|
+
version: 1.5.0.beta.2
|
6
13
|
platform: ruby
|
7
|
-
authors:
|
14
|
+
authors:
|
8
15
|
- Christian Neukirchen
|
9
16
|
autorequire:
|
10
17
|
bindir: bin
|
11
18
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
19
|
+
|
20
|
+
date: 2013-01-13 00:00:00 Z
|
21
|
+
dependencies:
|
22
|
+
- !ruby/object:Gem::Dependency
|
15
23
|
name: bacon
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :development
|
23
24
|
prerelease: false
|
24
|
-
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: rake
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
33
26
|
none: false
|
34
|
-
requirements:
|
35
|
-
- -
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
|
27
|
+
requirements:
|
28
|
+
- - ">="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
hash: 3
|
31
|
+
segments:
|
32
|
+
- 0
|
33
|
+
version: "0"
|
38
34
|
type: :development
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rake
|
39
38
|
prerelease: false
|
40
|
-
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
40
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
47
|
-
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 3
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
version: "0"
|
48
|
+
type: :development
|
49
|
+
version_requirements: *id002
|
50
|
+
description: |
|
51
|
+
Rack provides a minimal, modular and adaptable interface for developing
|
48
52
|
web applications in Ruby. By wrapping HTTP requests and responses in
|
49
|
-
|
50
53
|
the simplest way possible, it unifies and distills the API for web
|
51
|
-
|
52
54
|
servers, web frameworks, and software in between (the so-called
|
53
|
-
|
54
55
|
middleware) into a single method call.
|
55
|
-
|
56
|
-
|
56
|
+
|
57
57
|
Also see http://rack.github.com/.
|
58
58
|
|
59
|
-
'
|
60
59
|
email: chneukirchen@gmail.com
|
61
|
-
executables:
|
60
|
+
executables:
|
62
61
|
- rackup
|
63
62
|
extensions: []
|
64
|
-
|
63
|
+
|
64
|
+
extra_rdoc_files:
|
65
65
|
- README.rdoc
|
66
66
|
- KNOWN-ISSUES
|
67
|
-
files:
|
67
|
+
files:
|
68
68
|
- bin/rackup
|
69
69
|
- contrib/rack.png
|
70
70
|
- contrib/rack.svg
|
@@ -239,29 +239,40 @@ files:
|
|
239
239
|
- SPEC
|
240
240
|
homepage: http://rack.github.com/
|
241
241
|
licenses: []
|
242
|
+
|
242
243
|
post_install_message:
|
243
244
|
rdoc_options: []
|
244
|
-
|
245
|
+
|
246
|
+
require_paths:
|
245
247
|
- lib
|
246
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
248
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
247
249
|
none: false
|
248
|
-
requirements:
|
249
|
-
- -
|
250
|
-
- !ruby/object:Gem::Version
|
251
|
-
|
252
|
-
|
250
|
+
requirements:
|
251
|
+
- - ">="
|
252
|
+
- !ruby/object:Gem::Version
|
253
|
+
hash: 3
|
254
|
+
segments:
|
255
|
+
- 0
|
256
|
+
version: "0"
|
257
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
253
258
|
none: false
|
254
|
-
requirements:
|
255
|
-
- -
|
256
|
-
- !ruby/object:Gem::Version
|
259
|
+
requirements:
|
260
|
+
- - ">"
|
261
|
+
- !ruby/object:Gem::Version
|
262
|
+
hash: 25
|
263
|
+
segments:
|
264
|
+
- 1
|
265
|
+
- 3
|
266
|
+
- 1
|
257
267
|
version: 1.3.1
|
258
268
|
requirements: []
|
269
|
+
|
259
270
|
rubyforge_project: rack
|
260
|
-
rubygems_version: 1.8.
|
271
|
+
rubygems_version: 1.8.24
|
261
272
|
signing_key:
|
262
273
|
specification_version: 3
|
263
274
|
summary: a modular Ruby webserver interface
|
264
|
-
test_files:
|
275
|
+
test_files:
|
265
276
|
- test/spec_auth_basic.rb
|
266
277
|
- test/spec_auth_digest.rb
|
267
278
|
- test/spec_body_proxy.rb
|
@@ -309,3 +320,4 @@ test_files:
|
|
309
320
|
- test/spec_urlmap.rb
|
310
321
|
- test/spec_utils.rb
|
311
322
|
- test/spec_webrick.rb
|
323
|
+
has_rdoc:
|