diff --git a/actions/azurestorage.js b/actions/azurestorage.js index 68206580..75821451 100644 --- a/actions/azurestorage.js +++ b/actions/azurestorage.js @@ -210,31 +210,31 @@ export const getBlobs = async (containerName, casefolderID) => { "/api/file/downloadblob?container=" + containerName + "&casefolderID=" + - casefolderID + + encodeURIComponent(casefolderID) + "&blobname=" + - blob.name, + encodeURIComponent(blob.name), "hashedfilepath": hashAPIPath( "/api/file/downloadblob?container=" + containerName + "&casefolderID=" + - casefolderID + + encodeURIComponent(casefolderID) + "&blobname=" + - blob.name.split("/")[2] + encodeURIComponent(blob.name.split("/")[2]) ), "deletepath": "/api/file/deleteblob?container=" + containerName + "&casefolderID=" + - casefolderID + + encodeURIComponent(casefolderID) + "&blobname=" + - blob.name.split("/")[2], + encodeURIComponent(blob.name.split("/")[2]), "hasheddeletepath": hashAPIPath( "/api/file/deleteblob?container=" + containerName + "&casefolderID=" + - casefolderID + + encodeURIComponent(casefolderID) + "&blobname=" + - blob.name.split("/")[2] + encodeURIComponent(blob.name.split("/")[2]) ), "hashgetblobs": hashAPIPath( "/api/file/getbloblist?container=" + @@ -1235,17 +1235,17 @@ export const getProgressBlobs = async (containerName, caseReference) => { "/api/file/downloadblob?container=" + containerName + "&casefolderID=" + - caseReference + + encodeURIComponent(caseReference) + "&blobname=" + - blob.name.split("/")[1] + encodeURIComponent(blob.name.split("/")[1]) ), "hasheddeletepath": hashAPIPath( "/api/file/deleteblob?container=" + containerName + "&casefolderID=" + - caseReference + + encodeURIComponent(caseReference) + "&blobname=" + - blob.name.split("/")[1] + encodeURIComponent(blob.name.split("/")[1]) ), "hashgetblobs": hashAPIPath( "/api/file/getbloblist?container=" + @@ -1406,20 +1406,20 @@ export const getRepsFilesBlobs = async ( "/api/file/downloadblob?container=" + containerName + "&casefolderID=" + - blob.name.split("/")[0] + - "/" + - blob.name.split("/")[1] + + encodeURIComponent( + blob.name.split("/")[0] + "/" + blob.name.split("/")[1] + ) + "&blobname=" + - blob.name.split("/")[3], + encodeURIComponent(blob.name.split("/")[3]), "hashedfilepath": hashAPIPath( "/api/file/downloadblob?container=" + containerName + "&casefolderID=" + - blob.name.split("/")[0] + - "/" + - blob.name.split("/")[1] + + encodeURIComponent( + blob.name.split("/")[0] + "/" + blob.name.split("/")[1] + ) + "&blobname=" + - blob.name + encodeURIComponent(blob.name.split("/")[3]) ), "deletepath": "/api/file/deleteblob?container=" + @@ -1434,11 +1434,11 @@ export const getRepsFilesBlobs = async ( "/api/file/deleteblob?container=" + containerName + "&casefolderID=" + - blob.name.split("/")[0] + - "/" + - blob.name.split("/")[1] + + encodeURIComponent( + blob.name.split("/")[0] + "/" + blob.name.split("/")[1] + ) + "&blobname=" + - blob.name.split("/")[3] + encodeURIComponent(blob.name.split("/")[3]) ), "hashgetblobs": hashAPIPath( "/api/file/getbloblist?container=" + @@ -1450,7 +1450,7 @@ export const getRepsFilesBlobs = async ( ), }); } - //console.log("blobObj:", blobObj); + console.log("blobObj:", blobObj); return blobObj; }; diff --git a/actions/index.js b/actions/index.js index 8f32f50f..e995a893 100644 --- a/actions/index.js +++ b/actions/index.js @@ -1762,9 +1762,9 @@ export const deleteBlob = async ( "/api/file/deleteblob?container=" + containerName + "&casefolderID=" + - casefolderID + + encodeURIComponent(casefolderID) + "&blobname=" + - blobName + + encodeURIComponent(blobName) + deleteblobhash ); return res.data; @@ -1785,11 +1785,9 @@ export const deleteRepBlob = async ( "/api/file/deleteblob?container=" + containerName + "&casefolderID=" + - casefolderID + - "/" + - filenamePrefix + + encodeURIComponent(casefolderID + "/" + filenamePrefix) + "&blobname=" + - blobName + + encodeURIComponent(blobName) + deleteblobhash ); return res.data; @@ -1843,14 +1841,14 @@ export const getProgressFromBlob = async (containerName, casereference) => { const res = await axios.get( BASE_URL + "/api/file/getprogressobjblob?container=" + - containerName + + encodeURIComponent(containerName) + "&casefolderID=" + - casereference + + encodeURIComponent(casereference) + hashAPIPath( "/api/file/getprogressobjblob?container=" + - containerName + + encodeURIComponent(containerName) + "&casefolderID=" + - casereference + encodeURIComponent(casereference) ) ); return res.data; diff --git a/pages/api/file/deleteblob.js b/pages/api/file/deleteblob.js index 64ca4d30..465dc167 100644 --- a/pages/api/file/deleteblob.js +++ b/pages/api/file/deleteblob.js @@ -17,12 +17,9 @@ ApiProxy.get(async (req, res) => { "/api/file/deleteblob?container=" + containerName + "&casefolderID=" + - casefolderID + + encodeURIComponent(casefolderID) + "&blobname=" + - blobName; - - //console.log(hashAPIPath(checkquerypath), checkHash); - //console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash); + encodeURIComponent(blobName); if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) { await deleteBlob( diff --git a/pages/api/file/downloadblob.js b/pages/api/file/downloadblob.js index 5ad78d18..9e43fdb7 100644 --- a/pages/api/file/downloadblob.js +++ b/pages/api/file/downloadblob.js @@ -20,15 +20,9 @@ ApiProxy.get(async (req, res) => { "/api/file/downloadblob?container=" + containerName + "&casefolderID=" + - casefolderID + + encodeURIComponent(casefolderID) + "&blobname=" + - blobName.trim(); - - // console.log(checkquerypath); - - // console.log(hashAPIPath(checkquerypath)); - - // console.log(req.query); + encodeURIComponent(blobName.trim()); if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) { const bloblocation =