From 59f736c9a0de25e716e9a79a32fe27d539b138ad Mon Sep 17 00:00:00 2001 From: dakshina Date: Fri, 6 Dec 2024 14:27:37 +0530 Subject: [PATCH] make policy path check case-insensitive --- .../wso2/carbon/apimgt/persistence/RegistryPersistenceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/RegistryPersistenceImpl.java b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/RegistryPersistenceImpl.java index d7a8e2077193..52f799f742f9 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/RegistryPersistenceImpl.java +++ b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/RegistryPersistenceImpl.java @@ -2751,7 +2751,7 @@ public Mediation getMediationPolicy(Organization org, String apiId, String media int prependIndex = apiPath.lastIndexOf("/api"); String apiResourcePath = apiPath.substring(0, prependIndex); String policyPath = GovernanceUtils.getArtifactPath(registry, mediationPolicyId); - if (!policyPath.startsWith(apiResourcePath)) { + if (!policyPath.toLowerCase().startsWith(apiResourcePath.toLowerCase())) { throw new MediationPolicyPersistenceException("Policy not foud ", ExceptionCodes.POLICY_NOT_FOUND); } Resource mediationResource = registry.get(policyPath);