diff --git a/ballerina-tests/http-advanced-tests/tests/http_cache_config_annotation_test.bal b/ballerina-tests/http-advanced-tests/tests/http_cache_config_annotation_test.bal index 54b925d9d2..e9afd1a256 100644 --- a/ballerina-tests/http-advanced-tests/tests/http_cache_config_annotation_test.bal +++ b/ballerina-tests/http-advanced-tests/tests/http_cache_config_annotation_test.bal @@ -331,11 +331,11 @@ function testReturnStatusCodeResponsesWithAnnotation() returns error? { function testBasicCachingBehaviourWithExecute() returns error? { check checkBasicCachingBehaviourWithExecute("GET", 1); runtime:sleep(1); - check checkBasicCachingBehaviourWithExecute("get", 2); + check checkBasicCachingBehaviourWithExecute("get", 1); runtime:sleep(1); - check checkBasicCachingBehaviourWithExecute("HEAD", 3); + check checkBasicCachingBehaviourWithExecute("HEAD", 2); runtime:sleep(1); - check checkBasicCachingBehaviourWithExecute("head", 4); + check checkBasicCachingBehaviourWithExecute("head", 2); } function checkBasicCachingBehaviourWithExecute(string method, int hitCount) returns error? { diff --git a/ballerina/caching_http_cache.bal b/ballerina/caching_http_cache.bal index cf300ffb8b..be06fd6d38 100644 --- a/ballerina/caching_http_cache.bal +++ b/ballerina/caching_http_cache.bal @@ -194,5 +194,5 @@ isolated function weakValidatorEquals(string etag1, string etag2) returns boolea } isolated function getCacheKey(string httpMethod, string url) returns string { - return string `${httpMethod} ${url}`; + return string `${httpMethod.toUpperAscii()} ${url}`; }