diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2014-11-26 20:16:06 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2014-11-26 20:16:06 -0200 |
commit | 99a1a62572e6d75d29ef569c58eae70ed9ad3255 (patch) | |
tree | cab51cdebaf1f517c3a22a6aa492b91afe87e561 | |
parent | f08b5a197f9d95657c484ba7c67de7ea398e592c (diff) | |
download | rack-99a1a62572e6d75d29ef569c58eae70ed9ad3255.tar.gz |
MultipartLimitError => MultipartPartLimitError
-rw-r--r-- | lib/rack/multipart/parser.rb | 4 | ||||
-rw-r--r-- | test/spec_request.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/rack/multipart/parser.rb b/lib/rack/multipart/parser.rb index 63df7c00..fa90ca96 100644 --- a/lib/rack/multipart/parser.rb +++ b/lib/rack/multipart/parser.rb @@ -2,7 +2,7 @@ require 'rack/utils' module Rack module Multipart - class MultipartLimitError < Errno::EMFILE; end + class MultipartPartLimitError < Errno::EMFILE; end class Parser BUFSIZE = 16384 @@ -49,7 +49,7 @@ module Rack opened_files = 0 loop do if Utils.multipart_part_limit > 0 - raise MultipartLimitError, 'Maximum file multiparts in content reached' if opened_files >= Utils.multipart_part_limit + raise MultipartPartLimitError, 'Maximum file multiparts in content reached' if opened_files >= Utils.multipart_part_limit opened_files += 1 end diff --git a/test/spec_request.rb b/test/spec_request.rb index 25e69649..6f379a0b 100644 --- a/test/spec_request.rb +++ b/test/spec_request.rb @@ -745,7 +745,7 @@ EOF f[:tempfile].size.should.equal 76 end - should "MultipartLimitError when request has too many multipart parts if limit set" do + should "MultipartPartLimitError when request has too many multipart parts if limit set" do begin data = 10000.times.map { "--AaB03x\r\nContent-Type: text/plain\r\nContent-Disposition: attachment; name=#{SecureRandom.hex(10)}; filename=#{SecureRandom.hex(10)}\r\n\r\ncontents\r\n" }.join("\r\n") data += "--AaB03x--\r" @@ -757,7 +757,7 @@ EOF } request = Rack::Request.new Rack::MockRequest.env_for("/", options) - lambda { request.POST }.should.raise(Rack::Multipart::MultipartLimitError) + lambda { request.POST }.should.raise(Rack::Multipart::MultipartPartLimitError) end end |