Skip to content

Commit

Permalink
fix: handle versions in subpaths (#15614)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenoh authored Nov 8, 2023
1 parent b6648ef commit 367fde4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ public ResponseEntity<String> runWithSubpath(

private Optional<String> getSubPath(String path, String id) {
String prefix = String.format("%s/%s/run/", RouteSchemaDescriptor.API_ENDPOINT, id);
if (path.startsWith(prefix)) {

if (path.startsWith(prefix, 3)) {
return Optional.of(path.substring(prefix.length() + 3));
} else if (path.startsWith(prefix)) {
return Optional.of(path.substring(prefix.length()));
}

return Optional.empty();
}
}

0 comments on commit 367fde4

Please sign in to comment.