TASK22224: accept encoded hash variants for downloadblob

This commit is contained in:
2026-03-23 17:04:30 +00:00
parent f09f3b75cc
commit bd3bf6834b
+31 -7
View File
@@ -32,15 +32,39 @@ ApiProxy.get(async (req, res) => {
});
}
const checkquerypath =
const blobNameTrimmed = blobName.trim();
const hashCandidatePaths = [
"/api/file/downloadblob?container=" +
containerName +
"&casefolderID=" +
casefolderID +
"&blobname=" +
blobName.trim();
containerName +
"&casefolderID=" +
casefolderID +
"&blobname=" +
blobNameTrimmed,
"/api/file/downloadblob?container=" +
containerName +
"&casefolderID=" +
encodeURIComponent(casefolderID) +
"&blobname=" +
blobNameTrimmed,
"/api/file/downloadblob?container=" +
containerName +
"&casefolderID=" +
casefolderID +
"&blobname=" +
encodeURIComponent(blobNameTrimmed),
"/api/file/downloadblob?container=" +
containerName +
"&casefolderID=" +
encodeURIComponent(casefolderID) +
"&blobname=" +
encodeURIComponent(blobNameTrimmed)
];
if (hashAPIPath(checkquerypath) != "&hash=" + checkHash) {
const isHashValid = hashCandidatePaths.some(
(candidatePath) => hashAPIPath(candidatePath) == "&hash=" + checkHash
);
if (!isHashValid) {
return respondError(res, {
status: 400,
code: "INVALID_HASH",