diff options
Diffstat (limited to 'actionpack')
-rwxr-xr-x | actionpack/lib/action_controller/request.rb | 1 | ||||
-rw-r--r-- | actionpack/test/controller/request_test.rb | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index 68a5ea3701..e9a2e797dd 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -598,6 +598,7 @@ module ActionController end raise EOFError, "bad boundary end of body part" unless boundary_end=~/--/ + body.rewind if body.respond_to?(:rewind) params end end diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb index 1bb01ffd00..c62b2a6ec7 100644 --- a/actionpack/test/controller/request_test.rb +++ b/actionpack/test/controller/request_test.rb @@ -719,7 +719,9 @@ class MultipartRequestParameterParsingTest < Test::Unit::TestCase private def process(name) File.open(File.join(FIXTURE_PATH, name), 'rb') do |file| - ActionController::AbstractRequest.parse_multipart_form_parameters(file, 'AaB03x', file.stat.size, {}) + params = ActionController::AbstractRequest.parse_multipart_form_parameters(file, 'AaB03x', file.stat.size, {}) + assert_equal 0, file.pos # file was rewound after reading + params end end end |