Changeset 4410
- Timestamp:
- 06/02/06 06:30:23 (2 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb (modified) (1 diff)
- trunk/actionpack/test/controller/cgi_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r4406 r4410 1 1 *SVN* 2 3 * Rewind readable CGI params so others may reread them (such as CGI::Session when passing the session id in a multipart form). #210 [mklame@atxeu.com, matthew@walker.wattle.id.au] 2 4 3 5 * Added Mime::TEXT (text/plain) and Mime::ICS (text/calendar) as new default types [DHH] trunk/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb
r4344 r4410 184 184 elsif value.respond_to?(:read) 185 185 # Value as part of a multipart request 186 value.read 186 result = value.read 187 value.rewind 188 result 187 189 elsif value.class == Array 188 190 value.collect { |v| CGIMethods.get_typed_value(v) } trunk/actionpack/test/controller/cgi_test.rb
r4388 r4410 304 304 end 305 305 306 # Rewind readable cgi params so others may reread them (such as CGI::Session 307 # when passing the session id in a multipart form). 308 def test_multipart_param_rewound 309 params = process('text_file') 310 assert_equal 'bar', @cgi.params['foo'][0].read 311 end 312 306 313 private 307 314 def process(name) … … 310 317 ENV['CONTENT_LENGTH'] = file.stat.size.to_s 311 318 $stdin = file 312 CGIMethods.parse_request_parameters CGI.new.params 319 @cgi = CGI.new 320 CGIMethods.parse_request_parameters @cgi.params 313 321 end 314 322 ensure