Changeset 8226
- Timestamp:
- 11/28/07 00:29:43 (1 year ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/caching.rb (modified) (1 diff)
- trunk/actionpack/test/controller/caching_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r8220 r8226 1 1 *SVN* 2 3 * Added protection from trailing slashes on page caching #10229 [devrieda] 2 4 3 5 * Asset timestamps are appended, not prepended. Closes #10276 [mnaberez] trunk/actionpack/lib/action_controller/caching.rb
r8001 r8226 107 107 private 108 108 def page_cache_file(path) 109 name = ( (path.empty? || path == "/") ? "/index" : URI.unescape(path))109 name = (path.empty? || path == "/") ? "/index" : URI.unescape(path.chomp('/')) 110 110 name << page_cache_extension unless (name.split('/').last || name).include? '.' 111 111 return name trunk/actionpack/test/controller/caching_test.rb
r8164 r8226 36 36 head :ok 37 37 end 38 39 def trailing_slash 40 render :text => "Sneak attack" 41 end 38 42 end 39 43 … … 91 95 get :expire_custom_path 92 96 assert !File.exist?("#{FILE_STORE_PATH}/index.html") 97 end 98 99 def test_should_cache_without_trailing_slash_on_url 100 @controller.class.cache_page 'cached content', '/page_caching_test/trailing_slash' 101 assert File.exist?("#{FILE_STORE_PATH}/page_caching_test/trailing_slash.html") 102 end 103 104 def test_should_cache_with_trailing_slash_on_url 105 @controller.class.cache_page 'cached content', '/page_caching_test/trailing_slash/' 106 assert File.exist?("#{FILE_STORE_PATH}/page_caching_test/trailing_slash.html") 93 107 end 94 108