diff options
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal/rack_delegation.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/rendering.rb | 10 |
2 files changed, 6 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/metal/rack_delegation.rb b/actionpack/lib/action_controller/metal/rack_delegation.rb index bdf6e88699..e1bee9e60c 100644 --- a/actionpack/lib/action_controller/metal/rack_delegation.rb +++ b/actionpack/lib/action_controller/metal/rack_delegation.rb @@ -5,8 +5,8 @@ module ActionController module RackDelegation extend ActiveSupport::Concern - delegate :headers, :status=, :location=, :content_type=, - :status, :location, :content_type, :to => "@_response" + delegate :headers, :status=, :location=, :content_type=, :no_content_type=, + :status, :location, :content_type, :no_content_type, :to => "@_response" def dispatch(action, request) set_response!(request) diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb index ce37eaefd8..3c4ef596c7 100644 --- a/actionpack/lib/action_controller/metal/rendering.rb +++ b/actionpack/lib/action_controller/metal/rendering.rb @@ -44,15 +44,13 @@ module ActionController def _process_format(format, options = {}) super - self.content_type ||= format.to_s - if options[:body].present? - self.content_type = "none" + if options[:body] self.headers.delete "Content-Type" - end - - if options[:plain].present? + elsif options[:plain] self.content_type = Mime::TEXT + else + self.content_type ||= format.to_s end end |