Merge branch 'main' into dev

This commit is contained in:
SillyLossy
2023-04-06 10:50:04 +03:00
2 changed files with 23 additions and 10 deletions

View File

@@ -174,9 +174,11 @@ app.use((req, res, next) => {
if (req.url.startsWith('/characters/') && is_colab && process.env.googledrive == 2) {
const filePath = path.join(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();