Skip to content

Build your personal knowledge base with Trilium Notes

Update apps/server/src/etapi/notes.ts

Elian Doranb99486259ecb
diff --git a/apps/server/src/etapi/notes.ts b/apps/server/src/etapi/notes.ts
index d85f128240..544efd9dc6 100644
--- a/apps/server/src/etapi/notes.ts
+++ b/apps/server/src/etapi/notes.ts
@@ -67,7 +67,7 @@ function register(router: Router) {
const params = _params as NoteParams;
// Validate MIME type for image notes
- if (params.type === "image" && params.mime && !params.mime.startsWith("image/")) {
+ if (params.type === "image" && params.mime && !params.mime.toLowerCase().startsWith("image/")) {
throw new eu.EtapiError(400, "INVALID_MIME_FOR_IMAGE", `MIME type '${params.mime}' is not allowed for image notes. MIME must start with 'image/'.`);
}