mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 03:00:41 +01:00
image handling consistency fixes
This commit is contained in:
@@ -34,7 +34,7 @@ function uploadImage(req) {
|
||||
return [404, `Note ${noteId} doesn't exist.`];
|
||||
}
|
||||
|
||||
if (!["image/png", "image/jpeg", "image/gif", "image/webp"].includes(file.mimetype)) {
|
||||
if (!["image/png", "image/jpeg", "image/gif", "image/webp", "image/svg+xml"].includes(file.mimetype)) {
|
||||
return [400, "Unknown image type: " + file.mimetype];
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ function updateImage(req) {
|
||||
return [404, `Note ${noteId} doesn't exist.`];
|
||||
}
|
||||
|
||||
if (!["image/png", "image/jpeg", "image/gif", "image/webp"].includes(file.mimetype)) {
|
||||
if (!["image/png", "image/jpeg", "image/gif", "image/webp", "image/svg+xml"].includes(file.mimetype)) {
|
||||
return {
|
||||
uploaded: false,
|
||||
message: "Unknown image type: " + file.mimetype
|
||||
|
||||
@@ -8,7 +8,7 @@ const noteService = require('../../services/notes');
|
||||
function uploadImage(req) {
|
||||
const file = req.file;
|
||||
|
||||
if (!["image/png", "image/jpeg", "image/gif"].includes(file.mimetype)) {
|
||||
if (!["image/png", "image/jpeg", "image/gif", "image/webp", "image/svg+xml"].includes(file.mimetype)) {
|
||||
return [400, "Unknown image type: " + file.mimetype];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user