]> git.openstreetmap.org Git - rails.git/commitdiff
Allow GET as well as POST for oauth#request_token and oauth#access_token
authorTom Hughes <tom@compton.nu>
Mon, 23 Sep 2013 12:47:05 +0000 (13:47 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 23 Sep 2013 12:47:05 +0000 (13:47 +0100)
config/routes.rb
test/functional/oauth_controller_test.rb

index c65954b223e95e3ca3fbef390fa4d484f01986cb..7e078539ee1d6e86f0d06b612a4aef9cbf19de4f 100644 (file)
@@ -247,8 +247,8 @@ OpenStreetMap::Application.routes.draw do
   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
+  match '/oauth/request_token' => 'oauth#request_token', :via => [:get, :post], :as => :request_token
+  match '/oauth/access_token' => 'oauth#access_token', :via => [:get, :post], :as => :access_token
   match '/oauth/test_request' => 'oauth#test_request', :via => :get, :as => :test_request
 
   # roles and banning pages
index 42f3c3c9915fd141377d816206670bbebaae4345..85358892e9d73d24f39af394ddf703bac51c4663 100644 (file)
@@ -28,10 +28,18 @@ class OauthControllerTest < ActionController::TestCase
       { :path => "/oauth/request_token", :method => :get },
       { :controller => "oauth", :action => "request_token" }
     )
+    assert_routing(
+      { :path => "/oauth/request_token", :method => :post },
+      { :controller => "oauth", :action => "request_token" }
+    )
     assert_routing(
       { :path => "/oauth/access_token", :method => :get },
       { :controller => "oauth", :action => "access_token" }
     )
+    assert_routing(
+      { :path => "/oauth/access_token", :method => :post },
+      { :controller => "oauth", :action => "access_token" }
+    )
     assert_routing(
       { :path => "/oauth/test_request", :method => :get },
       { :controller => "oauth", :action => "test_request" }