Tolerate missing content type on multipart file uploads. Fix for Safari 3.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7005 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2007-06-12 07:44:23 +00:00
parent e4e275dde3
commit 979c22444d
4 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,7 @@
*SVN*
* Tolerate missing content type on multipart file uploads. Fix for Safari 3. [Jeremy Kemper]
* Deprecation: remove pagination. Install the classic_pagination plugin for forward compatibility, or move to the superior will_paginate plugin. #8157 [Josh Peek]
* Action caching is limited to GET requests returning 200 OK status. #3335 [tom@craz8.com, halfbyte, Dan Kubb, Josh Peek]

View File

@ -423,10 +423,8 @@ module ActionController
when Array
value.map { |v| get_typed_value(v) }
else
# Uploaded file provides content type and filename.
if value.respond_to?(:content_type) &&
!value.content_type.blank? &&
!value.original_filename.blank?
# This is an uploaded file.
if value.respond_to?(:original_filename) && !value.original_filename.blank?
unless value.respond_to?(:full_original_filename)
class << value
alias_method :full_original_filename, :original_filename

View File

@ -690,8 +690,8 @@ class MultipartRequestParameterParsingTest < Test::Unit::TestCase
file = params['file']
assert_kind_of StringIO, file
assert_equal 'file.txt', file.original_filename
assert_equal "text/plain\r", file.content_type
assert_equal 'file.csv', file.original_filename
assert_equal '', file.content_type
assert_equal 'contents', file.read
file = params['flowers']

Binary file not shown.