Skip to content

Commit

Permalink
fix(webserver): missing params in file paths
Browse files Browse the repository at this point in the history
close #4958
  • Loading branch information
Skraye committed Sep 18, 2024
1 parent 3187997 commit c65a5c8
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ public HttpResponse<StreamedFile> file(
@Parameter(description = "The execution id") @PathVariable String executionId,
@Parameter(description = "The internal storage uri") @QueryValue URI path
) throws IOException, URISyntaxException {
HttpResponse<StreamedFile> httpResponse = this.validateFile(executionId, path, "/api/v1/executions/{executionId}/file?path=" + path);
HttpResponse<StreamedFile> httpResponse = this.validateFile(executionId, path, "/api/v1/" + this.getTenant() + "executions/{executionId}/file?path=" + path);
if (httpResponse != null) {
return httpResponse;
}
Expand All @@ -680,7 +680,7 @@ public HttpResponse<FileMetas> filesize(
@Parameter(description = "The execution id") @PathVariable String executionId,
@Parameter(description = "The internal storage uri") @QueryValue URI path
) throws IOException {
HttpResponse<FileMetas> httpResponse = this.validateFile(executionId, path, "/api/v1/executions/{executionId}/file/metas?path=" + path);
HttpResponse<FileMetas> httpResponse = this.validateFile(executionId, path, "/api/v1/" + this.getTenant() + "executions/{executionId}/file/metas?path=" + path);
if (httpResponse != null) {
return httpResponse;
}
Expand Down Expand Up @@ -1443,7 +1443,7 @@ public HttpResponse<?> filePreview(
@Parameter(description = "The max row returns") @QueryValue @Nullable Integer maxRows,
@Parameter(description = "The file encoding as Java charset name. Defaults to UTF-8", example = "ISO-8859-1") @QueryValue(defaultValue = "UTF-8") String encoding
) throws IOException {
this.validateFile(executionId, path, "/api/v1/executions/{executionId}/file?path=" + path);
this.validateFile(executionId, path, "/api/v1/" + this.getTenant() + "executions/{executionId}/file?path=" + path);

String extension = FilenameUtils.getExtension(path.toString());
Optional<Charset> charset;
Expand Down Expand Up @@ -1644,4 +1644,8 @@ public List<FlowForExecution> getFlowsByNamespace(
return flowRepository.findByNamespaceExecutable(tenantService.resolveTenant(), namespace);
}

public String getTenant() {
return "";
}

}

0 comments on commit c65a5c8

Please sign in to comment.