Skip to content

Commit

Permalink
FIX roles parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
culmat committed Apr 18, 2024
1 parent 964a3f4 commit d897749
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/baloise/azure/FunctionalOrgEndpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public HttpResponseMessage v1(
return createAvatarResponse(request, path.get(1));
}

if(request.getQueryParameters().containsKey("clear")) graph().clear();
final StringTree child = graph().getOrg().getChild(path.toArray(new String[0]));

return child.isLeaf() ? createTeamResponse(request, context, child) : createOrganisationResponse(request, context, child);
Expand Down Expand Up @@ -137,7 +138,7 @@ private HttpResponseMessage createTeamResponse(HttpRequestMessage<Optional<Strin

String[] getRoles(HttpRequestMessage<Optional<String>> request) {
String roles = request.getQueryParameters().get("roles");
return (roles == null) ? new String[0] : roles.split("\\s+,\\s+");
return (roles == null) ? new String[0] : roles.trim().split("\\s*,\\s*");
}

private HttpResponseMessage createOrganisationResponse(HttpRequestMessage<Optional<String>> request, ExecutionContext context, StringTree tree)
Expand Down

0 comments on commit d897749

Please sign in to comment.