Skip to content

Commit

Permalink
fix reading of cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
tongueroo authored and meh committed Oct 16, 2016
1 parent dfa94cc commit 2c01799
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opal/browser/cookies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def [](name)

return if matches.empty?

result = matches.map {|cookie|
JSON.parse(cookie.match(/^.*?=(.*)$/)[1].decode_uri_component)
result = matches.flatten.map {|value|
JSON.parse(value.decode_uri_component)
}

result.length == 1 ? result.first : result
Expand Down

0 comments on commit 2c01799

Please sign in to comment.