Add download query param to assets endpoint

This commit is contained in:
rijkvanzanten
2020-10-19 12:45:10 -04:00
parent 552fbff5ed
commit 0f20f9ea7c
3 changed files with 14 additions and 5 deletions

View File

@@ -119,6 +119,10 @@ router.get(
res.attachment(file.filename_download);
res.setHeader('Content-Type', file.type);
if (req.query.hasOwnProperty('download') === false) {
res.removeHeader('Content-Disposition');
}
stream.pipe(res);
})
);