aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base/streaming.rb
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-15 11:21:08 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-15 11:21:08 -0700
commit5a8a550a45c5ca7abc9785ed180d5f46189c9958 (patch)
tree57e604e8485e34a6d7058c8f243e941d38bca949 /actionpack/lib/action_controller/base/streaming.rb
parentc50b03b754948b676b74c334edfb277fa45c1d14 (diff)
downloadrails-5a8a550a45c5ca7abc9785ed180d5f46189c9958.tar.gz
rails-5a8a550a45c5ca7abc9785ed180d5f46189c9958.tar.bz2
rails-5a8a550a45c5ca7abc9785ed180d5f46189c9958.zip
Finish making things pass with updated internal content_type semantics
Diffstat (limited to 'actionpack/lib/action_controller/base/streaming.rb')
-rw-r--r--actionpack/lib/action_controller/base/streaming.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/base/streaming.rb b/actionpack/lib/action_controller/base/streaming.rb
index 73d4bde6c1..5c72fc9ad9 100644
--- a/actionpack/lib/action_controller/base/streaming.rb
+++ b/actionpack/lib/action_controller/base/streaming.rb
@@ -162,15 +162,16 @@ module ActionController #:nodoc:
disposition <<= %(; filename="#{options[:filename]}") if options[:filename]
content_type = options[:type]
+
if content_type.is_a?(Symbol)
- raise ArgumentError, "Unknown MIME type #{options[:type]}" unless Mime::EXTENSION_LOOKUP.has_key?(content_type.to_s)
- content_type = Mime::Type.lookup_by_extension(content_type.to_s)
+ raise ArgumentError, "Unknown MIME type #{options[:type]}" unless Mime::EXTENSION_LOOKUP.key?(content_type.to_s)
+ self.content_type = Mime::Type.lookup_by_extension(content_type.to_s)
+ else
+ self.content_type = content_type
end
- content_type = content_type.to_s.strip # fixes a problem with extra '\r' with some browsers
headers.merge!(
'Content-Length' => options[:length],
- 'Content-Type' => content_type,
'Content-Disposition' => disposition,
'Content-Transfer-Encoding' => 'binary'
)