For example:
JWT.decode('e30K.e30K.e30K')
=> NoMethodError: undefined method `zero?' for nil:NilClass
I'd expect this to throw a JWT::IncorrectAlgorithm, but casecmp here:
|
allowed_algorithms.any? { |alg| alg.casecmp(header['alg']).zero? } |
returns
nil if alg is not set, so we get an unexpected NoMethodError.
For example:
I'd expect this to throw a
JWT::IncorrectAlgorithm, but casecmp here:ruby-jwt/lib/jwt/decode.rb
Line 46 in 2cea14f
nilif alg is not set, so we get an unexpected NoMethodError.