Skip to content

Commit

Permalink
Fixes for DS
Browse files Browse the repository at this point in the history
  • Loading branch information
PipeItToDevNull committed Jan 5, 2025
1 parent 189c7ed commit afe5a5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ const handleAnalyzeDmp = async (req, res) => {
res.status(400).send('Uploaded archive contains more than 10 files');
deleteFile(filePath);
} else {
const invalidFiles = files.filter(file => !checkFileHeader(path.join(filePath, file.name), logger, res));
const invalidFiles = files.filter(file => !checkFileHeader(path.join(filePath, file.name)));
if (invalidFiles.length > 0) {
logger.warn('Archive contains unsupported file types');
res.status(400).send('Uploaded archive contains unsupported file types');
Expand All @@ -239,7 +239,7 @@ const handleAnalyzeDmp = async (req, res) => {
// If mimetype is undefined use the checkFileHeader function
// to check first 4 bytes of the file, otherwise reject the file
} else {
if (checkFileHeader(uploadPath, logger, res)) {
if (checkFileHeader(uploadPath)) {
const filePath = `${uploadPath}.dmp`;
try {
await fs.promises.rename(uploadPath, filePath);
Expand Down

0 comments on commit afe5a5d

Please sign in to comment.