Skip to content

Commit

Permalink
Cleanup For Pull
Browse files Browse the repository at this point in the history
  • Loading branch information
mwawrusch committed May 30, 2011
1 parent e964093 commit ac737d2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
7 changes: 0 additions & 7 deletions lib/rack/oauth2/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,32 +164,25 @@ def initialize(app, options = Options.new, &authenticator)
attr_reader :options

def call(env)
puts "############ CALL #{options}"

request = OAuthRequest.new(env)
puts "############ CALL 1 Options Host: #{options.host} Request Host #{request.host}"

return @app.call(env) if options.host && options.host != request.host
puts "############ CALL 2"

return @app.call(env) if options.path && request.path.index(options.path) != 0

puts "############ CALL 3"

begin
# Use options.database if specified.
org_database, Server.database = Server.database, options.database || Server.database
logger = options.logger || env["rack.logger"]
puts "############ CALL 4 "

# 3. Obtaining End-User Authorization
# Flow starts here.
return request_authorization(request, logger) if request.path == options.authorize_path
puts "############ CALL 5"

# 4. Obtaining an Access Token
return respond_with_access_token(request, logger) if request.path == options.access_token_path
puts "############ CALL 6"

# 5. Accessing a Protected Resource
if request.authorization
Expand Down
1 change: 0 additions & 1 deletion lib/rack/oauth2/server/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def parse_redirect_uri(redirect_uri)
uri = URI.parse(redirect_uri).normalize rescue nil
raise InvalidRequestError, "Redirect URL looks fishy to me" unless uri
raise InvalidRequestError, "Redirect URL must be absolute URL" unless uri.absolute? && uri.host
# raise InvalidRequestError, "Redirect URL must point to HTTP/S location" unless uri.scheme == "http" || uri.scheme == "https"
uri
end

Expand Down

0 comments on commit ac737d2

Please sign in to comment.