Skip to content

Build your personal knowledge base with Trilium Notes

remove route without filename

Tomf0f9274a3c9a
diff --git a/src/routes/routes.js b/src/routes/routes.js
index 0cd2460c98..eb43083181 100644
--- a/src/routes/routes.js
+++ b/src/routes/routes.js
@@ -285,7 +285,8 @@ function register(app) {
apiRoute(POST, '/api/special-notes/search-note', specialNotesRoute.createSearchNote);
apiRoute(POST, '/api/special-notes/save-search-note', specialNotesRoute.saveSearchNote);
- route(GET, ['/api/images/:noteId/:filename', '/api/images/:noteId'], [auth.checkApiAuthOrElectron], imageRoute.returnImage);
+ // :filename is not used by trilium, but instead used for "save as" to assign a human readable filename
+ route(GET, '/api/images/:noteId/:filename', [auth.checkApiAuthOrElectron], imageRoute.returnImage);
route(POST, '/api/images', [auth.checkApiAuthOrElectron, uploadMiddleware, csrfMiddleware], imageRoute.uploadImage, apiResultHandler);
route(PUT, '/api/images/:noteId', [auth.checkApiAuthOrElectron, uploadMiddleware, csrfMiddleware], imageRoute.updateImage, apiResultHandler);
diff --git a/src/share/routes.js b/src/share/routes.js
index 684dde3e0d..edda89e95e 100644
--- a/src/share/routes.js
+++ b/src/share/routes.js
@@ -110,6 +110,7 @@ function register(router) {
res.send(note.getContent());
});
+ // :filename is not used by trilium, but instead used for "save as" to assign a human readable filename
router.get('/share/api/images/:noteId/:filename', (req, res, next) => {
shacaLoader.ensureLoad();