11# frozen_string_literal: true
22
33require "active_support"
4- require "active_support/version"
54require "action_controller"
65require "uri"
76
8- if Gem ::Version . new ( ActiveSupport ::VERSION ::STRING ) < Gem ::Version . new ( "3" )
9- # rails 2.x
10- require "action_controller/request"
11- unless ActionController ::Request ::HTTP_METHODS . include? ( "patch" )
12- ActionController ::Request ::HTTP_METHODS << "patch"
13- ActionController ::Request ::HTTP_METHOD_LOOKUP [ "PATCH" ] = :patch
14- ActionController ::Request ::HTTP_METHOD_LOOKUP [ "patch" ] = :patch
15- end
16-
17- elsif Gem ::Version . new ( ActiveSupport ::VERSION ::STRING ) < Gem ::Version . new ( "4" )
18- # rails 3.x
19- require "action_dispatch/http/request"
20- unless ActionDispatch ::Request ::HTTP_METHODS . include? ( "patch" )
21- ActionDispatch ::Request ::HTTP_METHODS << "patch"
22- ActionDispatch ::Request ::HTTP_METHOD_LOOKUP [ "PATCH" ] = :patch
23- ActionDispatch ::Request ::HTTP_METHOD_LOOKUP [ "patch" ] = :patch
24- end
25-
26- else # rails 4.x and later - already has patch
27- require "action_dispatch/http/request"
28- end
7+ require "action_dispatch/http/request"
298
309module OAuth
3110 module RequestProxy
3211 class ActionControllerRequest < OAuth ::RequestProxy ::Base
33- proxies ( defined? ( :: ActionDispatch :: AbstractRequest ) ? :: ActionDispatch :: AbstractRequest : ::ActionDispatch ::Request )
12+ proxies ( ::ActionDispatch ::Request )
3413
3514 def method
3615 request . method . to_s . upcase
@@ -50,7 +29,7 @@ def parameters
5029 end
5130 end
5231
53- # Override from OAuth::RequestProxy::Base to avoid roundtrip
32+ # Override from OAuth::RequestProxy::Base to avoid round-trip
5433 # conversion to Hash or Array and thus preserve the original
5534 # parameter names
5635 def parameters_for_signature
0 commit comments