From ba9aa51526523e27a51f95d7a676a70368c0859e Mon Sep 17 00:00:00 2001 From: praveenKDass Date: Fri, 19 Jul 2024 15:56:20 +0530 Subject: [PATCH] changes:using signedUrl for download in both private and public bucket --- module/files/helper.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/module/files/helper.js b/module/files/helper.js index 41dfff2..bfa23d3 100644 --- a/module/files/helper.js +++ b/module/files/helper.js @@ -159,22 +159,14 @@ module.exports = class FilesHelper { file: file, payload: { sourcePath: file }, cloudStorage: cloudStorage.toUpperCase(), - }; - if (process.env.CLOUD_STORAGE_PROVIDER !== constants.common.G_CLOUD) { - response.downloadableUrl = await cloudClient.getDownloadableUrl( - bucket, - file, - linkExpireTime // Link ExpireIn - ); - }else{ - // Generate a read-only pre-signed URL for downloading a file from the GCloud bucket + }; + // Generate a read-only pre-signed URL for downloading a file from the Cloud bucket response.getDownloadableUrl = await cloudClient.getSignedUrl( bucket, // bucket name file, // file path linkExpireTime, // expire constants.common.READ_PERMISSION // read/write ); - } if (!serviceUpload) { response.url = await cloudClient.getSignedUrl( bucket, // bucket name