From 0c55bc6a092c7481a285a9c31b4894428bff12b2 Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Thu, 6 Apr 2023 00:20:47 +0300 Subject: [PATCH] Another colab fix --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 85a69a190..55e01c316 100644 --- a/server.js +++ b/server.js @@ -168,9 +168,11 @@ app.use((req, res, next) => { if (req.url.startsWith('/characters/') && is_colab && process.env.googledrive == 2) { const filePath = path.join(__dirname, charactersPath, decodeURIComponent(req.url.substr('/characters'.length))); + console.log('req.url: ' + req.url); + console.log(filePath); fs.access(filePath, fs.constants.R_OK, (err) => { if (!err) { - res.sendFile(filePath); + res.sendFile(filePath, { root: __dirname }); } else { res.send('Character not found: ' + filePath); //next();