From f84c4113527f07cd91565389d9a8840aba579bd2 Mon Sep 17 00:00:00 2001 From: Gaspard Bucher Date: Wed, 26 Aug 2009 11:12:10 +0200 Subject: [PATCH] Fixed missing 'Content-Type' header in send_file. --- .../lib/action_controller/metal/streaming.rb | 1 + actionpack/test/controller/send_file_test.rb | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/actionpack/lib/action_controller/metal/streaming.rb b/actionpack/lib/action_controller/metal/streaming.rb index 4761763..ff26c6a 100644 --- a/actionpack/lib/action_controller/metal/streaming.rb +++ b/actionpack/lib/action_controller/metal/streaming.rb @@ -169,6 +169,7 @@ module ActionController #:nodoc: end headers.merge!( + 'Content-Type' => self.content_type, 'Content-Length' => options[:length].to_s, 'Content-Disposition' => disposition, 'Content-Transfer-Encoding' => 'binary' diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb index 0afebac..087e948 100644 --- a/actionpack/test/controller/send_file_test.rb +++ b/actionpack/test/controller/send_file_test.rb @@ -123,6 +123,7 @@ class SendFileTest < ActionController::TestCase h = @controller.headers assert_equal '1', h['Content-Length'] assert_equal 'image/png', @controller.content_type + assert_equal 'image/png', h['Content-Type'] assert_equal 'disposition; filename="filename"', h['Content-Disposition'] assert_equal 'binary', h['Content-Transfer-Encoding'] -- 1.6.0