Sha256: bfe76eed4c64b35f2bb20c02686082855de484bf95ae4232668a63b5e5ec2bdf
Contents?: true
Size: 735 Bytes
Versions: 41
Compression:
Stored size: 735 Bytes
Contents
require 'rack/request' module Rack module Auth class AbstractRequest def initialize(env) @env = env end def request @request ||= Request.new(@env) end def provided? !authorization_key.nil? end def parts @parts ||= @env[authorization_key].split(' ', 2) end def scheme @scheme ||= parts.first.downcase 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
41 entries across 36 versions & 11 rubygems