RED-6864 - Remove fileProxyStreamForDownload as it closes the stream before downloading the file

This commit is contained in:
Andrei Isvoran 2023-08-17 14:37:17 +03:00
parent 7f7e1d2699
commit 04212cdd4e

View File

@ -211,7 +211,6 @@ public class DownloadController implements DownloadResource {
TenantContext.setTenantId(tenantId);
var downloadStatus = getDownloadStatus(storageId, userId);
var fileDownloadStream = getFileForDownload(storageId, userId);
fileProxyStreamForDownload(fileDownloadStream);
return getResponseEntity(inline, new InputStreamResource(fileDownloadStream), downloadStatus.getFilename(), MediaType.parseMediaType("application/zip"), downloadStatus.getFileSize());
});
@ -282,7 +281,6 @@ public class DownloadController implements DownloadResource {
var token = oneTimeTokenDownloadService.getToken(oneTimeToken);
var downloadStatus = getDownloadStatus(token.getStorageId(), token.getUserId());
var fileDownloadStream = getFileForDownload(token.getStorageId(), token.getUserId());
fileProxyStreamForDownload(fileDownloadStream);
TenantContext.clear();