Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rack::Auth::AbstractRequest#scheme returns strings
 * This is a breaking API change, but doesn't appear to be used in public
  • Loading branch information
raggi committed Jan 13, 2013
1 parent a13426b commit 0c76175
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 76 deletions.
12 changes: 0 additions & 12 deletions lib/rack.rb
Expand Up @@ -73,18 +73,6 @@ module Digest
autoload :Params, "rack/auth/digest/params"
autoload :Request, "rack/auth/digest/request"
end

# Not all of the following schemes are "standards", but they are used often.
@schemes = %w[basic digest bearer mac token oauth oauth2]

def self.add_scheme scheme
@schemes << scheme
@schemes.uniq!
end

def self.schemes
@schemes.dup
end
end

module Session
Expand Down
6 changes: 1 addition & 5 deletions lib/rack/auth/abstract/request.rb
Expand Up @@ -21,11 +21,7 @@ def parts
end

def scheme
@scheme ||=
begin
s = parts.first.downcase
Rack::Auth.schemes.include?(s) ? s.to_sym : s
end
@scheme ||= parts.first.downcase
end

def params
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/auth/basic.rb
Expand Up @@ -41,7 +41,7 @@ def valid?(auth)

class Request < Auth::AbstractRequest
def basic?
!parts.first.nil? && :basic == scheme
!parts.first.nil? && "basic" == scheme
end

def credentials
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/auth/digest/request.rb
Expand Up @@ -11,7 +11,7 @@ def method
end

def digest?
:digest == scheme
"digest" == scheme
end

def correct_uri?
Expand Down
57 changes: 0 additions & 57 deletions test/spec_auth.rb

This file was deleted.

0 comments on commit 0c76175

Please sign in to comment.