From 025949102edb5f31219f053bbab07b3c2b9a555a Mon Sep 17 00:00:00 2001 From: Scott Barron Date: Sun, 30 Oct 2005 13:13:02 +0000 Subject: Fix problem where redirecting components can cause an infinite loop [Rick Olson] Closes #2654 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2829 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/CHANGELOG | 2 ++ actionpack/lib/action_controller/base.rb | 1 + actionpack/test/controller/components_test.rb | 5 +++++ 3 files changed, 8 insertions(+) (limited to 'actionpack') diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index f9611126bf..15e60ba276 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fix problem where redirecting components can cause an infinite loop [Rick Olson] + * Added support for the queue option on visual_effect [Thomas Fuchs] * Update script.aculo.us to V1.5_rc4 [Thomas Fuchs] diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 334dc1b4d5..fa047e18c2 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -805,6 +805,7 @@ module ActionController #:nodoc: raise "You must assign a template class through ActionController.template_class= before processing a request" unless @@template_class response.template = self.class.view_class.new(self.class.view_root, {}, self) + response.redirected_to = nil @performed_render = @performed_redirect = false end diff --git a/actionpack/test/controller/components_test.rb b/actionpack/test/controller/components_test.rb index de7e8f7260..d10f7102c2 100644 --- a/actionpack/test/controller/components_test.rb +++ b/actionpack/test/controller/components_test.rb @@ -116,6 +116,11 @@ class ComponentsTest < Test::Unit::TestCase assert_redirected_to :action => "being_called" end + def test_component_multiple_redirect_redirects + test_component_redirect_redirects + test_internal_calling + end + def test_component_as_string_redirect_renders_redirecte_action get :calling_redirected_as_string -- cgit v1.2.3