diff --git a/include/jwt/jwt.hpp b/include/jwt/jwt.hpp index b057421..0933905 100644 --- a/include/jwt/jwt.hpp +++ b/include/jwt/jwt.hpp @@ -563,7 +563,7 @@ public: // Exposed APIs /** * Checks whether a claim is present in the payload * or not. - * @note: Claim name is case insensitive for this API. + * @note: Claim name is case sensitive for this API. */ //TODO: Not all libc++ version agrees with this //because count() is not made const for is_transparent @@ -659,25 +659,25 @@ private: bool operator()(const std::string& lhs, const std::string& rhs) const { - int ret = strcasecmp(lhs.c_str(), rhs.c_str()); + int ret = strcmp(lhs.c_str(), rhs.c_str()); return (ret < 0); } bool operator()(const jwt::string_view lhs, const jwt::string_view rhs) const { - int ret = strcasecmp(lhs.data(), rhs.data()); + int ret = strcmp(lhs.data(), rhs.data()); return (ret < 0); } bool operator()(const std::string& lhs, const jwt::string_view rhs) const { - int ret = strcasecmp(lhs.data(), rhs.data()); + int ret = strcmp(lhs.data(), rhs.data()); return (ret < 0); } bool operator()(const jwt::string_view lhs, const std::string& rhs) const { - int ret = strcasecmp(lhs.data(), rhs.data()); + int ret = strcmp(lhs.data(), rhs.data()); return (ret < 0); } }; diff --git a/tests/test_jwt_decode b/tests/test_jwt_decode deleted file mode 100755 index 29bc579..0000000 Binary files a/tests/test_jwt_decode and /dev/null differ diff --git a/tests/test_jwt_decode.cc b/tests/test_jwt_decode.cc index e076596..4933665 100644 --- a/tests/test_jwt_decode.cc +++ b/tests/test_jwt_decode.cc @@ -93,7 +93,9 @@ TEST (DecodeTest, DecodeHS256) EXPECT_TRUE (obj.has_claim("iss")); EXPECT_TRUE (obj.payload().has_claim_with_value("iss", "arun.muralidharan")); - EXPECT_TRUE (obj.has_claim("IAT")); + + //Case sensitive search + EXPECT_FALSE (obj.has_claim("IAT")); EXPECT_TRUE (obj.payload().has_claim_with_value(jwt::registered_claims::issued_at, 1513862371)); EXPECT_FALSE (obj.payload().has_claim_with_value(jwt::registered_claims::issued_at, 1513862372)); diff --git a/tests/test_jwt_decode_verifiy_with_exception b/tests/test_jwt_decode_verifiy_with_exception deleted file mode 100755 index 858928d..0000000 Binary files a/tests/test_jwt_decode_verifiy_with_exception and /dev/null differ diff --git a/tests/test_jwt_decode_verify b/tests/test_jwt_decode_verify deleted file mode 100755 index 1d9989a..0000000 Binary files a/tests/test_jwt_decode_verify and /dev/null differ