aboutsummaryrefslogtreecommitdiffstats
path: root/test/cgi
diff options
context:
space:
mode:
authorxibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-09 05:32:19 +0000
committerxibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-09 05:32:19 +0000
commit7fd78fad3e9d650f7dcdfdd40b3045e3a5443f20 (patch)
tree3d571fe072de9ac3c9712bbe6ce6436eab15b356 /test/cgi
parent57da3d94aa649614958d5ceef989f3fd758c2bb7 (diff)
downloadruby-7fd78fad3e9d650f7dcdfdd40b3045e3a5443f20.tar.gz
* lib/cgi/core.rb: fix multipart form parsing bug. [Bug #3866]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/cgi')
-rw-r--r--test/cgi/test_cgi_multipart.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/cgi/test_cgi_multipart.rb b/test/cgi/test_cgi_multipart.rb
index c123aa80b5..b51bb7fe2c 100644
--- a/test/cgi/test_cgi_multipart.rb
+++ b/test/cgi/test_cgi_multipart.rb
@@ -272,7 +272,7 @@ class CGIMultipartTest < Test::Unit::TestCase
ex = assert_raise(EOFError) do
cgi = RUBY_VERSION>="1.9" ? CGI.new(:accept_charset=>"UTF-8") : CGI.new
end
- assert_equal("bad boundary end of body part", ex.message)
+ assert_equal("bad content body", ex.message)
#
_prepare(@data) do |input|
input2 = input.sub(/--(\r\n)?\z/, "")
@@ -303,6 +303,19 @@ class CGIMultipartTest < Test::Unit::TestCase
assert_equal('file1.html', cgi['file1'].original_filename)
end
+ def test_cgi_multipart_boundary_10240 # [Bug #3866]
+ @boundary = 'AaB03x'
+ @data = [
+ {:name=>'file', :value=>"b"*10134,
+ :filename=>'file.txt', :content_type=>'text/plain'},
+ {:name=>'foo', :value=>"bar"},
+ ]
+ _prepare(@data)
+ cgi = RUBY_VERSION>="1.9" ? CGI.new(:accept_charset=>"UTF-8") : CGI.new
+ assert_equal(cgi['foo'], 'bar')
+ assert_equal(cgi['file'].read, 'b'*10134)
+ end
+
###
self.instance_methods.each do |method|