Sha256: ebbdbae553d8dbe287455e4a255c5b5353c62137eb527322e68065b885629c4e
Contents?: true
Size: 650 Bytes
Versions: 97
Compression:
Stored size: 650 Bytes
Contents
module Rack module Auth class AbstractRequest def initialize(env) @env = env end def provided? !authorization_key.nil? end def parts @parts ||= @env[authorization_key].split(' ', 2) end def scheme @scheme ||= parts.first.downcase.to_sym end def params @params ||= parts.last end private AUTHORIZATION_KEYS = ['HTTP_AUTHORIZATION', 'X-HTTP_AUTHORIZATION', 'X_HTTP_AUTHORIZATION'] def authorization_key @authorization_key ||= AUTHORIZATION_KEYS.detect { |key| @env.has_key?(key) } end end end end
Version data entries
97 entries across 96 versions & 26 rubygems