TASK22224: big parity bundle for completion message routes

This commit is contained in:
2026-03-23 18:09:36 +00:00
parent 9f5ec6f50a
commit 91a0ab82ea
4 changed files with 200 additions and 109 deletions
@@ -2,7 +2,6 @@ import {
downloadAllProgressFiles,
getAllProgressBlobs
} from "../../../actions/azurestorage";
import _ from "lodash";
import nextConnect from "next-connect";
import middleware from "../middleware/middleware";
import { hashAPIPath } from "../../../actions/core/hash";
@@ -28,10 +27,17 @@ ApiProxy.get(async (req, res) => {
});
}
const checkquerypath =
"/api/file/getawaitingsubmissionfromblob?container=" + containerName;
const hashCandidatePaths = [
"/api/file/getawaitingsubmissionfromblob?container=" + containerName,
"/api/file/getawaitingsubmissionfromblob?container=" +
encodeURIComponent(containerName)
];
if (hashAPIPath(checkquerypath) != "&hash=" + checkHash) {
const isHashValid = hashCandidatePaths.some(
(candidatePath) => hashAPIPath(candidatePath) == "&hash=" + checkHash
);
if (!isHashValid) {
return respondError(res, {
status: 400,
code: "INVALID_HASH",