Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tolerate missing content type on multipart file uploads. Fix for Safa…

…ri 3.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7005 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 979c22444d832e51b29c0404e3b990cab00606e9 1 parent e4e275d
@jeremy jeremy authored
View
2  actionpack/CHANGELOG
@@ -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
6 actionpack/lib/action_controller/request.rb
@@ -423,10 +423,8 @@ def get_typed_value(value)
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
4 actionpack/test/controller/request_test.rb
@@ -690,8 +690,8 @@ def test_binary_file
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']
View
BIN  actionpack/test/fixtures/multipart/binary_file
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.