added hashing on api calls
This commit is contained in:
@@ -13,11 +13,18 @@ const ApiProxy = nextConnect();
|
||||
ApiProxy.use(middleware);
|
||||
|
||||
ApiProxy.post(async (req, res) => {
|
||||
var checkHash = req.query.hash;
|
||||
console.log(JSON.parse(req.body.appealData));
|
||||
console.log(req.files);
|
||||
|
||||
const appealData = JSON.parse(req.body.appealData);
|
||||
|
||||
// var checkquerypath = "/api/file/upload";
|
||||
|
||||
// console.log(hashAPIPath(checkquerypath), checkHash);
|
||||
// console.log(hashAPIPath(checkquerypath) == "?hash=" + checkHash);
|
||||
|
||||
// if (hashAPIPath(checkquerypath) == "?hash=" + checkHash) {
|
||||
createContainer(appealData.pinswg_name.trim()).then((containerName) => {
|
||||
createBlob(appealData, containerName).then((data) => {
|
||||
uploadFile(req.files, containerName, data);
|
||||
@@ -25,6 +32,9 @@ ApiProxy.post(async (req, res) => {
|
||||
});
|
||||
|
||||
return res.status(200).json({ data: "success" });
|
||||
// } else {
|
||||
// return res.status(400).json();
|
||||
// }
|
||||
});
|
||||
|
||||
export const config = {
|
||||
|
||||
Reference in New Issue
Block a user