TASK22057: phase17 closeout hash/input consistency hardening
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user