Ticket #1689: file_upload_fixes.diff
| File file_upload_fixes.diff, 1.9 kB (added by fcheung, 6 months ago) |
|---|
-
actionpack/test/controller/dispatcher_test.rb
old new 16 16 end 17 17 18 18 def teardown 19 ENV ['REQUEST_METHOD'] = nil19 ENV.delete 'REQUEST_METHOD' 20 20 end 21 21 22 22 def test_clears_dependencies_after_dispatch_if_in_loading_mode -
actionpack/test/controller/request_test.rb
old new 731 731 assert_equal 'bar', params['foo'] 732 732 733 733 file = params['file'] 734 assert_kind_of Tempfile, file 734 if RUBY_VERSION > '1.9' 735 assert_kind_of File, file 736 else 737 assert_kind_of Tempfile, file 738 end 735 739 assert_equal 'file.txt', file.original_filename 736 740 assert_equal "text/plain", file.content_type 737 741 assert ('a' * 20480) == file.read -
actionpack/lib/action_controller/request.rb
old new 473 473 when Array 474 474 value.map { |v| get_typed_value(v) } 475 475 else 476 if value. is_a?(UploadedFile)476 if value.respond_to? :original_filename 477 477 # Uploaded file 478 478 if value.original_filename 479 479 value … … 498 498 def read_multipart(body, boundary, content_length, env) 499 499 params = Hash.new([]) 500 500 boundary = "--" + boundary 501 quoted_boundary = Regexp.quote(boundary , "n")501 quoted_boundary = Regexp.quote(boundary) 502 502 buf = "" 503 503 bufsize = 10 * 1024 504 504 boundary_end=""