This commit is contained in:
Lucio Lelii 2019-02-27 14:47:49 +00:00
parent 2bf6b03a8a
commit 894bb1b78c
2 changed files with 2 additions and 4 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.common</groupId>
<artifactId>authorization-client</artifactId>
<version>2.0.3-SNAPSHOT</version>
<version>2.0.4-SNAPSHOT</version>
<name>authorization service client library</name>
<parent>

View File

@ -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);