mirror of
https://github.com/github/rails.git
synced 2026-01-29 16:28:09 -05:00
Rewind stdin if possible after multipart parsing.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7758 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user