From 31fcd15bb200d4366d8dfa66bdc9b84e9d5ca1a8 Mon Sep 17 00:00:00 2001 From: Christopher Swasey Date: Wed, 9 May 2012 12:11:53 -0400 Subject: [PATCH] Fix regex pattern in Header.parse to remove redundency and simplify --- lib/simple_oauth/header.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/simple_oauth/header.rb b/lib/simple_oauth/header.rb index 447dc9c..384a8c3 100644 --- a/lib/simple_oauth/header.rb +++ b/lib/simple_oauth/header.rb @@ -25,7 +25,7 @@ module SimpleOAuth 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