Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webserver): missing params in file paths #4966

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 tenantService.resolveTenant() != null ? tenantService.resolveTenant() + "/" : "";
}

}