aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/caching.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-03-01 01:44:50 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-03-01 01:44:50 +0000
commita29625fc801482229948155e8735cb163ded3916 (patch)
tree0cc9497f4db646e119f31787719da2c789722b16 /actionpack/lib/action_controller/caching.rb
parent6b93952ae6866a82adccc3a8c8d022f3ac674c59 (diff)
downloadrails-a29625fc801482229948155e8735cb163ded3916.tar.gz
rails-a29625fc801482229948155e8735cb163ded3916.tar.bz2
rails-a29625fc801482229948155e8735cb163ded3916.zip
Fixed caching to be aware of extensions (so you can cache files like api.wsdl or logo.png) #734 [Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@816 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/caching.rb')
-rw-r--r--actionpack/lib/action_controller/caching.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb
index cde5b4f1e9..e8200f6ded 100644
--- a/actionpack/lib/action_controller/caching.rb
+++ b/actionpack/lib/action_controller/caching.rb
@@ -90,7 +90,9 @@ module ActionController #:nodoc:
private
def page_cache_file(path)
- ((path.empty? || path == "/") ? "/index" : path) + ".html"
+ name = ((path.empty? || path == "/") ? "/index" : path)
+ name << '.html' unless path.split('/').last.include? '.'
+ return name
end
def page_cache_path(path)