aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/caching_test.rb
diff options
context:
space:
mode:
authorJose and Yehuda <wycats@gmail.com>2012-04-24 22:32:09 -0500
committerJose and Yehuda <wycats@gmail.com>2012-04-24 22:52:26 -0500
commit56cdc81c08b1847c5c1f699810a8c3b9ac3715a6 (patch)
treea896641a85a55eab01eb74a129dbcbb09f7f8b6b /actionpack/test/controller/caching_test.rb
parent0cc32c5fd7f875de61262b430bca23825691899b (diff)
downloadrails-56cdc81c08b1847c5c1f699810a8c3b9ac3715a6.tar.gz
rails-56cdc81c08b1847c5c1f699810a8c3b9ac3715a6.tar.bz2
rails-56cdc81c08b1847c5c1f699810a8c3b9ac3715a6.zip
Remove default match without specified method
In the current router DSL, using the +match+ DSL method will match all verbs for the path to the specified endpoint. In the vast majority of cases, people are currently using +match+ when they actually mean +get+. This introduces security implications. This commit disallows calling +match+ without an HTTP verb constraint by default. To explicitly match all verbs, this commit also adds a :via => :all option to +match+. Closes #5964
Diffstat (limited to 'actionpack/test/controller/caching_test.rb')
-rw-r--r--actionpack/test/controller/caching_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb
index a42c68a628..e8546cb154 100644
--- a/actionpack/test/controller/caching_test.rb
+++ b/actionpack/test/controller/caching_test.rb
@@ -102,8 +102,8 @@ class PageCachingTest < ActionController::TestCase
def test_page_caching_resources_saves_to_correct_path_with_extension_even_if_default_route
with_routing do |set|
set.draw do
- match 'posts.:format', :to => 'posts#index', :as => :formatted_posts
- match '/', :to => 'posts#index', :as => :main
+ get 'posts.:format', :to => 'posts#index', :as => :formatted_posts
+ get '/', :to => 'posts#index', :as => :main
end
@params[:format] = 'rss'
assert_equal '/posts.rss', @routes.url_for(@params)
@@ -560,7 +560,7 @@ class ActionCacheTest < ActionController::TestCase
def test_xml_version_of_resource_is_treated_as_different_cache
with_routing do |set|
set.draw do
- match ':controller(/:action(.:format))'
+ get ':controller(/:action(.:format))'
end
get :index, :format => 'xml'