Changeset 8327
- Timestamp:
- 12/07/07 04:20:20 (9 months ago)
- Files:
-
- trunk/actionpack/lib/action_controller/request.rb (modified) (1 diff)
- trunk/actionpack/test/controller/request_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_controller/request.rb
r8314 r8327 589 589 raise EOFError, "bad boundary end of body part" unless boundary_end=~/--/ 590 590 591 body.rewind if body.respond_to?(:rewind) 591 begin 592 body.rewind if body.respond_to?(:rewind) 593 rescue Errno::ESPIPE 594 # Handles exceptions raised by input streams that cannot be rewound 595 # such as when using plain CGI under Apache 596 end 597 592 598 params 593 599 end trunk/actionpack/test/controller/request_test.rb
r8235 r8327 737 737 end 738 738 739 uses_mocha "test_no_rewind_stream" do 740 def test_no_rewind_stream 741 # Ensures that parse_multipart_form_parameters works with streams that cannot be rewound 742 file = File.open(File.join(FIXTURE_PATH, 'large_text_file'), 'rb') 743 file.expects(:rewind).raises(Errno::ESPIPE) 744 params = ActionController::AbstractRequest.parse_multipart_form_parameters(file, 'AaB03x', file.stat.size, {}) 745 assert_not_equal 0, file.pos # file was not rewound after reading 746 end 747 end 748 739 749 def test_binary_file 740 750 params = process('binary_file')