TASK22057: phase17 closeout hash/input consistency hardening

This commit is contained in:
2026-03-13 18:43:42 +00:00
parent 36d35f9549
commit daa38d6459
7 changed files with 411 additions and 33 deletions
+15 -6
View File
@@ -178,13 +178,27 @@ export default async function handler(req, res) {
var checkquerypath = "/api/file/generatepdf";
if (shouldDownload) {
checkquerypath += "?download=true";
}
if (typeof checkHash === "undefined" || checkHash.length === 0) {
return res.status(400).json();
}
if (
hashAPIPath(checkquerypath) !=
(checkquerypath.indexOf("?") > -1 ? "&hash=" : "?hash=") + checkHash
) {
return res.status(400).json();
}
//console.log("-------", checkHash);
//console.log(hashAPIPath(checkquerypath) == "?hash=" + checkHash);
//console.log(casefolderID, caseRef);
// Create Document Component
const MyDocument = (values) => {
console.log(values.docProps.locale);
switch (values.docProps.representationType) {
case "Questionnaire":
switch (values.docProps.appealType) {
@@ -325,11 +339,6 @@ export default async function handler(req, res) {
reqBodyobj.repfile_name
)
.then((data) => {
console.log(
"///////////////////////////////////\nrep pdf file created: " +
`${caseRef}/files/${reqBodyobj.repfile_name}.pdf`,
"\n/////////////////////////"
);
if (shouldDownload) {
const filename = `${reqBodyobj.repfile_name || "questionnaire"}.pdf`;
res.setHeader("Content-Type", "application/pdf");