aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/base.rb2
-rw-r--r--actionpack/lib/action_controller/metal.rb14
-rw-r--r--actionpack/lib/action_controller/metal/head.rb4
3 files changed, 9 insertions, 11 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 55734b9774..105f69884d 100644
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -252,7 +252,7 @@ module ActionController
# Define some internal variables that should not be propagated to the view.
PROTECTED_IVARS = AbstractController::Rendering::DEFAULT_PROTECTED_INSTANCE_VARIABLES + [
- :@_status, :@_headers, :@_params, :@_response, :@_request,
+ :@_params, :@_response, :@_request,
:@_view_runtime, :@_stream, :@_url_options, :@_action_has_layout ]
def _protected_ivars # :nodoc:
diff --git a/actionpack/lib/action_controller/metal.rb b/actionpack/lib/action_controller/metal.rb
index 129e0bbd3c..51562ec0fb 100644
--- a/actionpack/lib/action_controller/metal.rb
+++ b/actionpack/lib/action_controller/metal.rb
@@ -150,10 +150,10 @@ module ActionController
# environment and response manually for performance reasons.
attr_internal :response, :request
- delegate :session, :headers, :to => "@_request"
+ delegate :session, :to => "@_request"
+ delegate :headers, :to => "@_response"
def initialize
- @_status = 200
@_request = nil
@_response = nil
@_routes = nil
@@ -177,7 +177,7 @@ module ActionController
end
def content_type
- headers["Content-Type"]
+ request.content_type
end
def location
@@ -194,12 +194,12 @@ module ActionController
end
def status
- @_status
+ response.status
end
alias :response_code :status # :nodoc:
def status=(status)
- @_status = Rack::Utils.status_code(status)
+ response.status = Rack::Utils.status_code(status)
end
def response_body=(body)
@@ -210,7 +210,7 @@ module ActionController
# Tests if render or redirect has already happened.
def performed?
- response_body || (response && response.committed?)
+ response_body || response.committed?
end
def dispatch(name, request, response) #:nodoc:
@@ -230,7 +230,7 @@ module ActionController
end
def to_a #:nodoc:
- response ? response.to_a : [status, headers, response_body]
+ response.to_a
end
class_attribute :middleware_stack
diff --git a/actionpack/lib/action_controller/metal/head.rb b/actionpack/lib/action_controller/metal/head.rb
index 7dbd5ef328..b2110bf946 100644
--- a/actionpack/lib/action_controller/metal/head.rb
+++ b/actionpack/lib/action_controller/metal/head.rb
@@ -36,8 +36,6 @@ module ActionController
headers[key.to_s.dasherize.split('-').each { |v| v[0] = v[0].chr.upcase }.join('-')] = value.to_s
end
- response.status = Rack::Utils.status_code(status)
-
self.status = status
self.location = url_for(location) if location
@@ -45,7 +43,7 @@ module ActionController
if include_content?(self.response_code)
self.content_type = content_type || (Mime[formats.first] if formats)
- self.response.charset = false if self.response
+ self.response.charset = false
end
true