lib/rack/multipart/generator.rb in rack-1.6.13 vs lib/rack/multipart/generator.rb in rack-2.0.0.alpha

- old
+ new

@@ -9,16 +9,16 @@ end end def dump return nil if @first && !multipart? - return flattened_params if !@first + return flattened_params unless @first flattened_params.map do |name, file| if file.respond_to?(:original_filename) - ::File.open(file.path, "rb") do |f| - f.set_encoding(Encoding::BINARY) if f.respond_to?(:set_encoding) + ::File.open(file.path, 'rb') do |f| + f.set_encoding(Encoding::BINARY) content_for_tempfile(f, file, name) end else content_for_other(file, name) end @@ -88,6 +88,6 @@ #{file}\r EOF end end end -end \ No newline at end of file +end