add application/epub as extra type

This commit is contained in:
daniel-j
2024-01-19 17:12:58 +01:00
parent 03b885a872
commit 36c7a4cf35
2 changed files with 5 additions and 1 deletions

View File

@@ -240,6 +240,10 @@ router.post('/upload', upload.single('file'), async ctx => {
mimetype = type.mime
}
if (mimetype == "application/epub") {
mimetype = TYPE_EPUB
}
if ((!type || !allowedTypes.includes(type.mime)) && !allowedTypes.includes(mimetype)) {
flash(ctx, {
message: 'Uploaded file is of an invalid type: ' + ctx.request.file.originalname + ' (' + (type? type.mime : 'unknown mimetype') + ')',