Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 7758

Show
Ignore:
Timestamp:
10/06/07 09:39:31 (1 year ago)
Author:
bitsweat
Message:

Rewind stdin if possible after multipart parsing.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/request.rb

    r7727 r7758  
    599599          raise EOFError, "bad boundary end of body part" unless boundary_end=~/--/ 
    600600 
     601          body.rewind if body.respond_to?(:rewind) 
    601602          params 
    602603        end 
  • trunk/actionpack/test/controller/request_test.rb

    r7416 r7758  
    720720    def process(name) 
    721721      File.open(File.join(FIXTURE_PATH, name), 'rb') do |file| 
    722         ActionController::AbstractRequest.parse_multipart_form_parameters(file, 'AaB03x', file.stat.size, {}) 
     722        params = ActionController::AbstractRequest.parse_multipart_form_parameters(file, 'AaB03x', file.stat.size, {}) 
     723        assert_equal 0, file.pos  # file was rewound after reading 
     724        params 
    723725      end 
    724726    end