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.