sotrage account calls security hardening

This commit is contained in:
2023-02-03 17:01:59 +00:00
parent a2ee8c58a6
commit 31362e4446
6 changed files with 109 additions and 46 deletions
+18 -14
View File
@@ -5,6 +5,7 @@ import {
import _ from "lodash";
import nextConnect from "next-connect";
import middleware from "../middleware/middleware";
import { hashAPIPath } from "../../../actions";
const ApiProxy = nextConnect();
ApiProxy.use(middleware);
@@ -20,22 +21,25 @@ ApiProxy.get(async (req, res) => {
"&casefolderID=" +
casefolderID;
// console.log(hashAPIPath(checkquerypath), checkHash);
//console.log(hashAPIPath(checkquerypath), checkHash);
// console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
//if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
const blobObj = await getProgressBlobs(containerName, casefolderID)
.then((data) => {
console.log("ertyuikjhgfg", data.path);
return downloadProgressFile(containerName, data.path, casefolderID);
})
.then((data) => {
return res.status(200).json(data);
});
// } else {
// return res.status(400).json();
// }
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
const blobObj = await getProgressBlobs(containerName, casefolderID)
.then((data) => {
console.log("Progress blob path:", data.path);
return downloadProgressFile(
containerName,
data.path,
casefolderID
);
})
.then((data) => {
return res.status(200).json(data);
});
} else {
return res.status(400).json();
}
});
export const config = {