diff options
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r-- | actionpack/lib/action_controller/metal/head.rb | 5 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/rack_delegation.rb | 17 |
2 files changed, 2 insertions, 20 deletions
diff --git a/actionpack/lib/action_controller/metal/head.rb b/actionpack/lib/action_controller/metal/head.rb index 056962b38c..7dbd5ef328 100644 --- a/actionpack/lib/action_controller/metal/head.rb +++ b/actionpack/lib/action_controller/metal/head.rb @@ -36,6 +36,8 @@ 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 @@ -44,9 +46,6 @@ 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 - else - headers.delete('Content-Type') - headers.delete('Content-Length') end true diff --git a/actionpack/lib/action_controller/metal/rack_delegation.rb b/actionpack/lib/action_controller/metal/rack_delegation.rb index eb8bca1d92..5ba9a47d63 100644 --- a/actionpack/lib/action_controller/metal/rack_delegation.rb +++ b/actionpack/lib/action_controller/metal/rack_delegation.rb @@ -12,17 +12,6 @@ module ActionController def build_with_env(env = {}) #:nodoc: new.tap { |c| c.set_request! ActionDispatch::Request.new(env) } end - - def make_response!(request) - ActionDispatch::Response.new.tap do |res| - res.request = request - end - end - end - - def set_request!(request) #:nodoc: - super - set_response!(request) end def response_body=(body) @@ -33,11 +22,5 @@ module ActionController def reset_session @_request.reset_session end - - private - - def set_response!(request) - @_response = self.class.make_response! request - end end end |