mirror of
https://github.com/samsonjs/simple_oauth.git
synced 2026-03-25 08:45:54 +00:00
Merge pull request #8 from endash/fix-space-in-header-bug
Fix regex pattern in Header.parse to remove redundency and simplify
This commit is contained in:
commit
f7124aba14
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue