aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/CHANGELOG2
-rwxr-xr-xactionpack/lib/action_controller/request.rb6
-rw-r--r--actionpack/test/controller/request_test.rb4
-rw-r--r--actionpack/test/fixtures/multipart/binary_filebin19846 -> 19820 bytes
4 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 1b73b7019b..3ae169883d 100644
--- a/actionpack/CHANGELOG
+++ b/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]
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb
index 2f0e86d2a2..5dbd4db9f5 100755
--- a/actionpack/lib/action_controller/request.rb
+++ b/actionpack/lib/action_controller/request.rb
@@ -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
diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb
index e14036fd2f..49c404244f 100644
--- a/actionpack/test/controller/request_test.rb
+++ b/actionpack/test/controller/request_test.rb
@@ -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']
diff --git a/actionpack/test/fixtures/multipart/binary_file b/actionpack/test/fixtures/multipart/binary_file
index 7e4c68c62e..556187ac1f 100644
--- a/actionpack/test/fixtures/multipart/binary_file
+++ b/actionpack/test/fixtures/multipart/binary_file
Binary files differ