diff --git a/pom.xml b/pom.xml index 1e77947..7664148 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.gcube.common authorization-client - 2.0.3-SNAPSHOT + 2.0.4-SNAPSHOT authorization service client library diff --git a/src/main/java/org/gcube/common/authorization/client/proxy/Utils.java b/src/main/java/org/gcube/common/authorization/client/proxy/Utils.java index a80cb99..996f1d3 100644 --- a/src/main/java/org/gcube/common/authorization/client/proxy/Utils.java +++ b/src/main/java/org/gcube/common/authorization/client/proxy/Utils.java @@ -15,9 +15,7 @@ public class Utils { protected static int getInfrastructureHashfromContext(String context) { try{ - String infrastructure = context; - if (context.startsWith("/")) - infrastructure = context.substring(1); + String infrastructure = context.replaceAll("^/?([^/]*)/?.*", "$1"); int hashcode= infrastructure.hashCode(); return Math.abs(hashcode);