]> git.openstreetmap.org Git - rails.git/commitdiff
Alloe GET as well as POST for oauth#revoke and oauth#authorize
authorTom Hughes <tom@compton.nu>
Sun, 22 Sep 2013 17:33:26 +0000 (18:33 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 22 Sep 2013 17:33:26 +0000 (18:33 +0100)
config/routes.rb
test/functional/oauth_controller_test.rb

index 514c6f756ba4b77ef065447c9fabaeb28a807dd3..04d1a763c66ff3bccb40d6bd7951adb195a62391 100644 (file)
@@ -244,8 +244,8 @@ OpenStreetMap::Application.routes.draw do
   scope "/user/:display_name" do
     resources :oauth_clients
   end
-  match '/oauth/revoke' => 'oauth#revoke', :via => :post
-  match '/oauth/authorize' => 'oauth#authorize', :via => :post, :as => :authorize
+  match '/oauth/revoke' => 'oauth#revoke', :via => [:get, :post]
+  match '/oauth/authorize' => 'oauth#authorize', :via => [:get, :post], :as => :authorize
   match '/oauth/token' => 'oauth#token', :via => :get, :as => :token
   match '/oauth/request_token' => 'oauth#request_token', :via => :get, :as => :request_token
   match '/oauth/access_token' => 'oauth#access_token', :via => :get, :as => :access_token
index d0ac28d0a99e109ed1957235c9d89e915c019928..42f3c3c9915fd141377d816206670bbebaae4345 100644 (file)
@@ -4,10 +4,18 @@ class OauthControllerTest < ActionController::TestCase
   ##
   # test all routes which lead to this controller
   def test_routes
+    assert_routing(
+      { :path => "/oauth/revoke", :method => :get },
+      { :controller => "oauth", :action => "revoke" }
+    )
     assert_routing(
       { :path => "/oauth/revoke", :method => :post },
       { :controller => "oauth", :action => "revoke" }
     )
+    assert_routing(
+      { :path => "/oauth/authorize", :method => :get },
+      { :controller => "oauth", :action => "authorize" }
+    )
     assert_routing(
       { :path => "/oauth/authorize", :method => :post },
       { :controller => "oauth", :action => "authorize" }