From 58331b067d82d2b6477ab3f98d9008e7c5a58d4b Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Tue, 22 Aug 2023 13:13:19 +0200 Subject: [PATCH] Fix collaboration of Nextcloud integration --- lib/http-worker.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/http-worker.js b/lib/http-worker.js index 147a7d841..3b98a4422 100644 --- a/lib/http-worker.js +++ b/lib/http-worker.js @@ -272,9 +272,18 @@ app.get(mainPagePattern, Express.static('./customize.dist')); app.use("/blob", Express.static(Path.resolve(Env.paths.blob), { maxAge: Env.DEV_MODE? "0d": "365d" })); -app.head("/datastore", Express.static(Env.paths.data, { - maxAge: "0d" -})); +app.use("/datastore", + (req, res, next) => { + if (req.method === 'HEAD') { + next(); + } else { + res.status(403).end(); + } + }, + Express.static(Env.paths.data, { + maxAge: "0d" + } +)); app.use('/block/', function (req, res, next) { var parsed = Path.parse(req.url);