public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
Fix bug that was caching redirected routes.  

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2373 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Wed Oct 18 10:49:31 -0700 2006
commit  a412bd8166837d0b930d7cd0ea5cbda6e217fbad
tree    3ac4a65b36b0feb9b1024c13d56fae5deb620043
parent  908a190a88be726841867ab24dab78ae05a4ec1e
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 * SVN *
0
 
0
+* Fix bug that was caching redirected routes.
0
+
0
 * fix wordpress converter bug, set default email on invalid comments. [Hampton Catlin]
0
 
0
 * change time delta so the end date is one second earlier, so a search doesn't include the articles on the next month. [Jon Leighton]
...
13
14
15
 
16
17
18
...
13
14
15
16
17
18
19
0
@@ -13,6 +13,7 @@ class MephistoController < ApplicationController
0
 
0
   protected
0
     def dispatch_redirect
0
+ @skip_caching = true
0
       # @section is the http status
0
       # @dispatch_path.first has the headers
0
       if @dispatch_path.first.is_a?(Hash)
...
19
20
21
22
 
23
24
25
...
71
72
73
74
 
75
76
77
...
19
20
21
 
22
23
24
25
...
71
72
73
 
74
75
76
77
0
@@ -19,7 +19,7 @@ Rails::Initializer.run do |config|
0
   # Skip frameworks you're not going to use
0
   # config.frameworks -= [ :action_web_service ]
0
 
0
- config.autoload_paths += %W( #{RAILS_ROOT}/app/cachers #{RAILS_ROOT}/app/drops #{RAILS_ROOT}/app/filters )
0
+ config.load_paths += %W( #{RAILS_ROOT}/app/cachers #{RAILS_ROOT}/app/drops #{RAILS_ROOT}/app/filters )
0
 
0
   # Force all environments to use the same logger level
0
   # (by default production uses :info, the others :debug)
0
@@ -71,7 +71,7 @@ UserMailer.mail_from = 'webmaster@localhost'
0
 # Redirect with a more specific set of variables
0
 #
0
 # Mephisto::Routing.redirect 'article/?/?/?' => 'new/$2/$1/$3'
0
-#
0
+
0
 # Multiple redirections at a time
0
 #
0
 # Mephisto::Routing.redirect \
...
364
365
366
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
367
368
369
...
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
0
@@ -364,6 +364,24 @@ class CachingTest < ActionController::IntegrationTest
0
     end
0
   end
0
 
0
+ def test_should_not_cache_denied_route
0
+ assert_expires_page '/limited_deny' do
0
+ visit { |v| v.get '/limited_deny' }
0
+ end
0
+
0
+ assert_not_cached '/limited_deny'
0
+ end
0
+
0
+ def test_should_not_cache_redirected_route
0
+ assert_expires_page '/redirect/external' do
0
+ visit do |v|
0
+ v.get '/redirect/external'
0
+ assert v.redirect?
0
+ assert_equal 'http://external', v.headers["location"].first
0
+ end
0
+ end
0
+ end
0
+
0
   protected
0
     def visit_sections_and_feeds_with(visitor)
0
       assert_difference CachedPage, :count, 4 do

Comments

    No one has commented yet.