Skip to content

Commit

Permalink
Merge pull request #294 from anakinj/fix-json-conflict-issue
Browse files Browse the repository at this point in the history
Fix JSON conflict between #293 and #292
  • Loading branch information
excpt committed Jan 21, 2019
2 parents 73ba6a0 + 39a9224 commit 7a9f1b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/jwt/decode.rb
Expand Up @@ -92,8 +92,8 @@ def signing_input
end

def parse_and_decode(segment)
JSON.parse(JWT::Base64.url_decode(segment))
rescue JSON::ParserError
JWT::JSON.parse(JWT::Base64.url_decode(segment))
rescue ::JSON::ParserError
raise JWT::DecodeError, 'Invalid segment encoding'
end
end
Expand Down

0 comments on commit 7a9f1b2

Please sign in to comment.