Sha256: 1c567e8673bb0856b32ecde98f6d67247837d72f3875585c9c0e02e23cd75204

Contents?: true

Size: 259 Bytes

Versions: 11

Compression:

Stored size: 259 Bytes

Contents

require 'rack/accept'

module GDS
  module SSO
    class ApiAccess
      def self.api_call?(env)
        request = Rack::Accept::Request.new(env)
        request.best_media_type(%w{application/json text/html}) == 'application/json'
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
gds-sso-0.6.0 lib/gds-sso/api_access.rb
gds-sso-0.5.4 lib/gds-sso/api_access.rb
gds-sso-0.5.3 lib/gds-sso/api_access.rb
gds-sso-0.5.2 lib/gds-sso/api_access.rb
gds-sso-0.5.1 lib/gds-sso/api_access.rb
gds-sso-0.5.0 lib/gds-sso/api_access.rb
gds-sso-0.4.3 lib/gds-sso/api_access.rb
gds-sso-0.4.2 lib/gds-sso/api_access.rb
gds-sso-0.4.1 lib/gds-sso/api_access.rb
gds-sso-0.4.0 lib/gds-sso/api_access.rb
gds-sso-0.3.0 lib/gds-sso/api_access.rb