fix: album download throws set headers errors

This commit is contained in:
Bobby Wibowo 2021-02-12 12:33:43 +07:00
parent 3ff139319f
commit 2addbb7b65
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF

View File

@ -469,6 +469,7 @@ self.generateZip = async (req, res, next) => {
const filePath = path.join(paths.zips, `${identifier}.zip`)
await paths.access(filePath)
await res.download(filePath, `${album.name}.zip`)
return
} catch (error) {
// Re-throw non-ENOENT error
if (error.code !== 'ENOENT') throw error