Skip to content
Browse files

Don't want Rack's Content-Type default header though

  • Loading branch information...
1 parent b1d4fb7 commit 8097da93ccbfaec82e7785ded7b3e68c8248b32f @jeremy jeremy committed May 24, 2009
Showing with 3 additions and 2 deletions.
  1. +3 −2 actionpack/lib/action_dispatch/http/response.rb
View
5 actionpack/lib/action_dispatch/http/response.rb
@@ -41,7 +41,8 @@ class Response < Rack::Response
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 @@ def sending_file?
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

0 comments on commit 8097da9

Please sign in to comment.
Something went wrong with that request. Please try again.