Sha256: de1148ef5a33861ad0f9f91d9803f029d85ca08b704e6f916bb4ab952ac24b1f

Contents?: true

Size: 890 Bytes

Versions: 25

Compression:

Stored size: 890 Bytes

Contents

require 'oauth/request_proxy/base'
require 'uri'
require 'rack'

module OAuth::RequestProxy
  class RackRequest < OAuth::RequestProxy::Base
    proxies Rack::Request

    def method
      request.env["rack.methodoverride.original_method"] || request.request_method
    end

    def uri
      request.url
    end

    def parameters
      if options[:clobber_request]
        options[:parameters] || {}
      else
        params = request_params.merge(query_params).merge(header_params)
        params.merge(options[:parameters] || {})
      end
    end

    def signature
      parameters['oauth_signature']
    end

  protected

    def query_params
      request.GET
    end

    def request_params
      if request.content_type and request.content_type.to_s.downcase.start_with?("application/x-www-form-urlencoded")
        request.POST
      else
        {}
      end
    end
  end
end

Version data entries

25 entries across 22 versions & 6 rubygems

Version Path
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/oauth-0.5.6/lib/oauth/request_proxy/rack_request.rb
oauth-0.5.6 lib/oauth/request_proxy/rack_request.rb
oauth-0.5.5 lib/oauth/request_proxy/rack_request.rb
tdiary-5.0.8 vendor/bundle/gems/oauth-0.5.4/lib/oauth/request_proxy/rack_request.rb
oauth-0.5.4 lib/oauth/request_proxy/rack_request.rb
tdiary-5.0.5 vendor/bundle/gems/oauth-0.5.1/lib/oauth/request_proxy/rack_request.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/oauth-0.5.1/lib/oauth/request_proxy/rack_request.rb
tdiary-5.0.5 vendor/bundle/gems/oauth-0.5.3/lib/oauth/request_proxy/rack_request.rb
oauth-0.5.3 lib/oauth/request_proxy/rack_request.rb
oauth-0.5.2 lib/oauth/request_proxy/rack_request.rb
tdiary-5.0.4 vendor/bundle/gems/oauth-0.5.1/lib/oauth/request_proxy/rack_request.rb
oauth-0.5.1 lib/oauth/request_proxy/rack_request.rb
oauth-0.5.0 lib/oauth/request_proxy/rack_request.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/oauth-0.4.7/lib/oauth/request_proxy/rack_request.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/oauth-0.4.7/lib/oauth/request_proxy/rack_request.rb
oauth-ap-0.4.8 lib/oauth/request_proxy/rack_request.rb
oauth-instructure-0.4.10 lib/oauth/request_proxy/rack_request.rb
oauth_weshays-0.4.8.pre2 lib/oauth/request_proxy/rack_request.rb
oauth_weshays-0.4.8.pre lib/oauth/request_proxy/rack_request.rb
oauth-instructure-0.4.9 lib/oauth/request_proxy/rack_request.rb