lib/oauthenticator/parse_authorization.rb in oauthenticator-1.3.1 vs lib/oauthenticator/parse_authorization.rb in oauthenticator-1.3.2

- old
+ new

@@ -33,10 +33,10 @@ header = header.to_s scanner = StringScanner.new(header) auth_parse_error = proc { |message| raise ParseError.new(message, {'Authorization' => [message]}) } scanner.scan(/OAuth\s*/i) || auth_parse_error.call("Authorization scheme is not OAuth - recieved: #{header}") attributes = Hash.new { |h,k| h[k] = [] } - while match = scanner.scan(/(\w+)="([^"]*)"\s*(,?)\s*/) + while scanner.scan(/(\w+)="([^"]*)"\s*(,?)\s*/) key = scanner[1] value = scanner[2] comma_follows = !scanner[3].empty? if !comma_follows && !scanner.eos? auth_parse_error.call("Could not parse Authorization header: #{header}\naround or after character #{scanner.pos}: #{scanner.rest}")