rack 1.5.4 → 1.5.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d55818e96ace1f944f520fbe49b80f007f6c32a8
4
- data.tar.gz: 26648f0efcd058816df3d6eb69c126d33fab4067
3
+ metadata.gz: ddc7522db220a6e7fef72e5720df45c3e78a9b54
4
+ data.tar.gz: c0b77fe5d69c8bcfbd315494f00541e4e72d4f35
5
5
  SHA512:
6
- metadata.gz: 54ec13d366e64034c71a6ea552b6a92d06c67c5737a7d7bcad36b24517ed9bf86e4a44895208ae268de2f973882972b6299bf73e55427a9145751868bab27b97
7
- data.tar.gz: 4a19a800a7315faa9d809520cbaa94dd8ae5d3c9d7e6e2b082a9de88f24071a43e37974204cd653192964e1370fd0647ef85d17d61592ed2e8ff8235d611d509
6
+ metadata.gz: 5c9e7ad0586b57f002aab11b31758620c0c314ff77998500d67a6bf1b7eb6c6edcd74630a0642ea71a78da8866a281c9f74a3f540fd6a9296e1bb4cf7ea3dcbe
7
+ data.tar.gz: 51fb9d24391b01c03a9dcc0c1b7cf453d7d3320be8bc97ce9bf4a65656cbe820ae1edef3d587b3595ed64c6dabe3e31d86effb92b79a3461a78dbdeb874375d7
@@ -20,7 +20,7 @@ module Rack
20
20
 
21
21
  # Return the Rack release as a dotted string.
22
22
  def self.release
23
- "1.5.4"
23
+ "1.5.5"
24
24
  end
25
25
 
26
26
  autoload :Builder, "rack/builder"
@@ -18,14 +18,15 @@ module Rack
18
18
 
19
19
  opened_files = 0
20
20
  loop do
21
- if Utils.multipart_part_limit > 0
22
- raise MultipartLimitError, 'Maximum file multiparts in content reached' if opened_files >= Utils.multipart_part_limit
23
- opened_files += 1
24
- end
25
21
 
26
22
  head, filename, content_type, name, body =
27
23
  get_current_head_and_filename_and_content_type_and_name_and_body
28
24
 
25
+ if Utils.multipart_part_limit > 0
26
+ opened_files += 1 if filename
27
+ raise MultipartLimitError, 'Maximum file multiparts in content reached' if opened_files >= Utils.multipart_part_limit
28
+ end
29
+
29
30
  # Save the rest.
30
31
  if i = @buf.index(rx)
31
32
  body << @buf.slice!(0, i)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "rack"
3
- s.version = "1.5.4"
3
+ s.version = "1.5.5"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.summary = "a modular Ruby webserver interface"
6
6
  s.license = "MIT"
@@ -0,0 +1 @@
1
+ 2015-06-16 14:11:43: (log.c.164) server started
@@ -0,0 +1,31 @@
1
+ --AaB03x
2
+ content-disposition: form-data; name="reply"
3
+
4
+ yes
5
+ --AaB03x
6
+ content-disposition: form-data; name="to"
7
+
8
+ people
9
+ --AaB03x
10
+ content-disposition: form-data; name="from"
11
+
12
+ others
13
+ --AaB03x
14
+ content-disposition: form-data; name="fileupload1"; filename="file1.jpg"
15
+ Content-Type: image/jpeg
16
+ Content-Transfer-Encoding: base64
17
+
18
+ /9j/4AAQSkZJRgABAQAAAQABAAD//gA+Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcg
19
+ --AaB03x
20
+ content-disposition: form-data; name="fileupload2"; filename="file2.jpg"
21
+ Content-Type: image/jpeg
22
+ Content-Transfer-Encoding: base64
23
+
24
+ /9j/4AAQSkZJRgABAQAAAQABAAD//gA+Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcg
25
+ --AaB03x
26
+ content-disposition: form-data; name="fileupload3"; filename="file3.jpg"
27
+ Content-Type: image/jpeg
28
+ Content-Transfer-Encoding: base64
29
+
30
+ /9j/4AAQSkZJRgABAQAAAQABAAD//gA+Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcg
31
+ --AaB03x--
@@ -389,6 +389,33 @@ Content-Type: image/jpeg\r
389
389
  end
390
390
  end
391
391
 
392
+ should "not reach a multi-part limit" do
393
+ begin
394
+ previous_limit = Rack::Utils.multipart_part_limit
395
+ Rack::Utils.multipart_part_limit = 4
396
+
397
+ env = Rack::MockRequest.env_for '/', multipart_fixture(:three_files_three_fields)
398
+ params = Rack::Multipart.parse_multipart(env)
399
+ params['reply'].should.equal 'yes'
400
+ params['to'].should.equal 'people'
401
+ params['from'].should.equal 'others'
402
+ ensure
403
+ Rack::Utils.multipart_part_limit = previous_limit
404
+ end
405
+ end
406
+
407
+ should "reach a multipart limit" do
408
+ begin
409
+ previous_limit = Rack::Utils.multipart_part_limit
410
+ Rack::Utils.multipart_part_limit = 3
411
+
412
+ env = Rack::MockRequest.env_for '/', multipart_fixture(:three_files_three_fields)
413
+ lambda { Rack::Multipart.parse_multipart(env) }.should.raise(Rack::Multipart::MultipartLimitError)
414
+ ensure
415
+ Rack::Utils.multipart_part_limit = previous_limit
416
+ end
417
+ end
418
+
392
419
  should "return nil if no UploadedFiles were used" do
393
420
  data = Rack::Multipart.build_multipart("people" => [{"submit-name" => "Larry", "files" => "contents"}])
394
421
  data.should.equal nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Neukirchen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-16 00:00:00.000000000 Z
11
+ date: 2015-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bacon
@@ -145,6 +145,7 @@ files:
145
145
  - test/cgi/assets/javascripts/app.js
146
146
  - test/cgi/assets/stylesheets/app.css
147
147
  - test/cgi/lighttpd.conf
148
+ - test/cgi/lighttpd.errors
148
149
  - test/cgi/rackup_stub.rb
149
150
  - test/cgi/sample_rackup.ru
150
151
  - test/cgi/test
@@ -172,6 +173,7 @@ files:
172
173
  - test/multipart/none
173
174
  - test/multipart/semicolon
174
175
  - test/multipart/text
176
+ - test/multipart/three_files_three_fields
175
177
  - test/multipart/webkit
176
178
  - test/rackup/config.ru
177
179
  - test/registering_handler/rack/handler/registering_myself.rb