diff options
author | Christiaan Van den Poel <christiaan.vandenpoel@protime.eu> | 2014-05-15 16:08:53 +0200 |
---|---|---|
committer | Christiaan Van den Poel <christiaan.vandenpoel@gmail.com> | 2014-05-15 21:14:46 +0200 |
commit | 20fece149185d7eed03d464b1bbc8a7636bb4f98 (patch) | |
tree | 7263acd880b1353e9396d7ce8af79cb0ff28b3b5 /actionpack/lib/action_controller | |
parent | cf50bbd68c6ceb5a1ac095c5407b79cfc7214788 (diff) | |
download | rails-20fece149185d7eed03d464b1bbc8a7636bb4f98.tar.gz rails-20fece149185d7eed03d464b1bbc8a7636bb4f98.tar.bz2 rails-20fece149185d7eed03d464b1bbc8a7636bb4f98.zip |
fixes stack level too deep exception on action named 'status' returning 'head :ok'
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/head.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/rack_delegation.rb | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal.rb b/actionpack/lib/action_controller/metal.rb index 0f4cc7a8f5..696fbf6e09 100644 --- a/actionpack/lib/action_controller/metal.rb +++ b/actionpack/lib/action_controller/metal.rb @@ -232,5 +232,9 @@ module ActionController new.dispatch(name, klass.new(env)) end end + + def _status_code + @_status + end end end diff --git a/actionpack/lib/action_controller/metal/head.rb b/actionpack/lib/action_controller/metal/head.rb index 43407f5b78..84a9112144 100644 --- a/actionpack/lib/action_controller/metal/head.rb +++ b/actionpack/lib/action_controller/metal/head.rb @@ -27,7 +27,7 @@ module ActionController self.status = status self.location = url_for(location) if location - if include_content?(self.status) + if include_content?(self._status_code) self.content_type = content_type || (Mime[formats.first] if formats) self.response.charset = false if self.response self.response_body = " " diff --git a/actionpack/lib/action_controller/metal/rack_delegation.rb b/actionpack/lib/action_controller/metal/rack_delegation.rb index bdf6e88699..6921834044 100644 --- a/actionpack/lib/action_controller/metal/rack_delegation.rb +++ b/actionpack/lib/action_controller/metal/rack_delegation.rb @@ -6,7 +6,7 @@ module ActionController extend ActiveSupport::Concern delegate :headers, :status=, :location=, :content_type=, - :status, :location, :content_type, :to => "@_response" + :status, :location, :content_type, :_status_code, :to => "@_response" def dispatch(action, request) set_response!(request) |