mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fixed that caches_action breaks with file extensions (closes #6257) [Catfish]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5248 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
211ffd3f79
commit
f9650a23f0
2 changed files with 8 additions and 1 deletions
|
@ -210,7 +210,7 @@ module ActionController #:nodoc:
|
|||
def set_content_type!(action_cache_path)
|
||||
if extention = action_cache_path.extension
|
||||
content_type = Mime::EXTENSION_LOOKUP[extention]
|
||||
action_cache_path.controller.content_type = content_type.to_s
|
||||
action_cache_path.controller.response.content_type = content_type.to_s
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -121,6 +121,13 @@ class ActionCacheTest < Test::Unit::TestCase
|
|||
assert_equal 'example.org/index', @path_class.path_for(@mock_controller)
|
||||
end
|
||||
|
||||
def test_file_extensions
|
||||
get :index, :id => 'kitten.jpg'
|
||||
get :index, :id => 'kitten.jpg'
|
||||
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def content_to_cache
|
||||
|
|
Loading…
Reference in a new issue