From 3b34f700f1af3cee87a591c5cecd897b5529dec0 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 22 Sep 2013 18:33:26 +0100 Subject: [PATCH] Alloe GET as well as POST for oauth#revoke and oauth#authorize --- config/routes.rb | 4 ++-- test/functional/oauth_controller_test.rb | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 514c6f756..04d1a763c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 diff --git a/test/functional/oauth_controller_test.rb b/test/functional/oauth_controller_test.rb index d0ac28d0a..42f3c3c99 100644 --- a/test/functional/oauth_controller_test.rb +++ b/test/functional/oauth_controller_test.rb @@ -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" } -- 2.43.2