🎨 Simplify header setting for file download response
This commit is contained in:
@@ -236,10 +236,7 @@ router.get('/download/:filename', (req, res) => {
|
|||||||
return res.status(404).json({ error: 'File not found' });
|
return res.status(404).json({ error: 'File not found' });
|
||||||
}
|
}
|
||||||
|
|
||||||
res.setHeader(
|
res.setHeader('Content-Disposition', `attachment; filename="${filename}"`);
|
||||||
'Content-Disposition',
|
|
||||||
`attachment; filename="${filename}"`
|
|
||||||
);
|
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.sendFile(filepath);
|
res.sendFile(filepath);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user