test/spec_multipart.rb in rack-2.0.0.alpha vs test/spec_multipart.rb in rack-2.0.0.rc1
- old
+ new
@@ -70,10 +70,17 @@
params.keys.each do |key|
key.encoding.must_equal Encoding::UTF_8
end
end
+ it "handles quoted encodings" do
+ # See #905
+ env = Rack::MockRequest.env_for("/", multipart_fixture(:unity3d_wwwform))
+ params = Rack::Multipart.parse_multipart(env)
+ params['user_sid'].encoding.must_equal Encoding::UTF_8
+ end
+
it "raise RangeError if the key space is exhausted" do
env = Rack::MockRequest.env_for("/", multipart_fixture(:content_type_and_no_filename))
old, Rack::Utils.key_space_limit = Rack::Utils.key_space_limit, 1
begin
@@ -86,9 +93,10 @@
it "parse multipart form webkit style" do
env = Rack::MockRequest.env_for '/', multipart_fixture(:webkit)
env['CONTENT_TYPE'] = "multipart/form-data; boundary=----WebKitFormBoundaryWLHCs9qmcJJoyjKR"
params = Rack::Multipart.parse_multipart(env)
params['profile']['bio'].must_include 'hello'
+ params['profile'].keys.must_include 'public_email'
end
it "reject insanely long boundaries" do
# using a pipe since a tempfile can use up too much space
rd, wr = IO.pipe