diff options
author | Rick Olson <technoweenie@gmail.com> | 2007-08-20 01:12:43 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2007-08-20 01:12:43 +0000 |
commit | 1a459e8e7d9f32e6c3a55153e8e1cfabef881839 (patch) | |
tree | 40bbe483e56b3e0a5b5a8a60e23e0090ff328481 | |
parent | bba22cedb4f3fc2554ab54175be3e20a701d53c8 (diff) | |
download | rails-1a459e8e7d9f32e6c3a55153e8e1cfabef881839.tar.gz rails-1a459e8e7d9f32e6c3a55153e8e1cfabef881839.tar.bz2 rails-1a459e8e7d9f32e6c3a55153e8e1cfabef881839.zip |
Fix bug where action caching sets the content type to the ActionCachePath object. Closes #9282 [mindforge]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7346 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/caching.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/caching_test.rb | 5 |
3 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 56ce3e1095..9eab683587 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fix bug where action caching sets the content type to the ActionCachePath object. Closes #9282 [mindforge] + * Find layouts even if they're not in the first view_paths directory. Closes #9258 [caio] * Major improvement to the documentation for the options / select form helpers. Closes #9038 [kampers, jardeon, wesg] diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb index 1b35cbe403..043b4ea761 100644 --- a/actionpack/lib/action_controller/caching.rb +++ b/actionpack/lib/action_controller/caching.rb @@ -231,7 +231,7 @@ module ActionController #:nodoc: cache_path = ActionCachePath.new(controller, path_options_for(controller, @options)) if cache = controller.read_fragment(cache_path.path) controller.rendered_action_cache = true - set_content_type!(controller, cache_path) + set_content_type!(controller, cache_path.extension) controller.send(:render_text, cache) false else diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 29fa0074f7..a9bc0471df 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -279,6 +279,11 @@ class ActionCacheTest < Test::Unit::TestCase assert_equal 'xml', path_object.extension assert_equal 'example.org/posts/index.xml', path_object.path end + + def test_correct_content_type_is_returned_for_cache_hit + get :index, :id => 'content-type.xml' + assert_equal 'application/xml', @response.content_type + end def test_empty_path_is_normalized @mock_controller.mock_url_for = 'http://example.org/' |