Skip to content

Commit

Permalink
fix DS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
PipeItToDevNull committed Jan 5, 2025
1 parent b3d2439 commit 189c7ed
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const deleteFile = async (deletePath) => {

// Function to check the first 4 bytes of a file
// If they are PAGE then it is a valid DMP
const checkFileHeader = (checkPath, logger, res) => {
const checkFileHeader = (checkPath) => {
const buffer = readChunkSync(checkPath, { length: 4, startPosition: 0 });
const fileHead = Array.from(buffer).map(byte => String.fromCharCode(byte)).join('');
if (fileHead !== 'PAGE') {
Expand Down Expand Up @@ -218,7 +218,6 @@ const handleAnalyzeDmp = async (req, res) => {
logger.warn('Archive contains unsupported file types');
res.status(400).send('Uploaded archive contains unsupported file types');
deleteFile(filePath);
return;
} else {
analyzeFile(filePath, res);
}
Expand Down Expand Up @@ -252,7 +251,7 @@ const handleAnalyzeDmp = async (req, res) => {
}
analyzeFile(filePath, res);
} else {
res.status(400).send(`Unsupported file header, file is not a valid .dmp`);
res.status(400).send('Unsupported file header, file is not a valid .dmp');
await deleteFile(uploadPath);
}
}
Expand Down

0 comments on commit 189c7ed

Please sign in to comment.