Permalink
Browse files

Fix regex pattern in Header.parse to remove redundency and simplify

  • Loading branch information...
1 parent ca16e1d commit 31fcd15bb200d4366d8dfa66bdc9b84e9d5ca1a8 Christopher Swasey committed May 9, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/simple_oauth/header.rb
@@ -25,7 +25,7 @@ def self.decode(value)
end
def self.parse(header)
- header.to_s.sub(/^OAuth\s/, '').split(/,[\s\t]*/).inject({}) do |attributes, pair|
+ header.to_s.sub(/^OAuth\s/, '').split(/,\s*/).inject({}) do |attributes, pair|
match = pair.match(/^(\w+)\=\"([^\"]*)\"$/)
attributes.merge(match[1].sub(/^oauth_/, '').to_sym => decode(match[2]))
end

0 comments on commit 31fcd15

Please sign in to comment.