mirror of
https://github.com/samsonjs/simple_oauth.git
synced 2026-04-27 14:57:45 +00:00
Fix regex pattern in Header.parse to remove redundency and simplify
This commit is contained in:
parent
ca16e1dfc4
commit
31fcd15bb2
1 changed files with 1 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ module SimpleOAuth
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.parse(header)
|
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+)\=\"([^\"]*)\"$/)
|
match = pair.match(/^(\w+)\=\"([^\"]*)\"$/)
|
||||||
attributes.merge(match[1].sub(/^oauth_/, '').to_sym => decode(match[2]))
|
attributes.merge(match[1].sub(/^oauth_/, '').to_sym => decode(match[2]))
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue