From 6cfe583535217a8f4aa31329e57fa01208e282b4 Mon Sep 17 00:00:00 2001 From: advplyr Date: Mon, 23 May 2022 18:31:11 -0500 Subject: [PATCH] Fix:Static router for downloading single file library items #627 --- server/routers/StaticRouter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/routers/StaticRouter.js b/server/routers/StaticRouter.js index b571869f..24b6f6da 100644 --- a/server/routers/StaticRouter.js +++ b/server/routers/StaticRouter.js @@ -17,7 +17,9 @@ class StaticRouter { if (!item) return res.status(404).send('Item not found with id ' + req.params.id) var remainingPath = req.params['0'] - var fullPath = Path.join(item.path, remainingPath) + var fullPath = null + if (item.isFile) fullPath = item.path + else fullPath = Path.join(item.path, remainingPath) res.sendFile(fullPath) }) }