From 8097da93ccbfaec82e7785ded7b3e68c8248b32f Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 24 May 2009 19:25:53 -0700 Subject: [PATCH] Don't want Rack's Content-Type default header though --- actionpack/lib/action_dispatch/http/response.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index a01114b730..b9db7a4508 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -41,7 +41,8 @@ module ActionDispatch # :nodoc: delegate :default_charset, :to => 'ActionController::Base' def initialize - super([], 200, DEFAULT_HEADERS) + super + @header = Rack::Utils::HeaderHash.new(DEFAULT_HEADERS) end # The response code of the request @@ -161,7 +162,7 @@ module ActionDispatch # :nodoc: end def assign_default_content_type_and_charset! - if type = headers['Content-Type'] + if type = headers['Content-Type'] || headers['type'] unless type =~ /charset=/ || sending_file? headers['Content-Type'] = "#{type}; charset=#{default_charset}" end