From a3205947455514baf3932040eb6a1f7d7f788197 Mon Sep 17 00:00:00 2001 From: Ben <36240171+benkyd@users.noreply.github.com> Date: Fri, 29 Apr 2022 19:15:24 +0100 Subject: [PATCH] oop Former-commit-id: 7bb0717dee29c173a99f09206ef9731d077e3fc0 --- src/routes/cdn.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/cdn.js b/src/routes/cdn.js index b734199..46342cb 100644 --- a/src/routes/cdn.js +++ b/src/routes/cdn.js @@ -22,7 +22,7 @@ function Get(req, res) { // if linux const defaultFile = `${process.cwd()}\\db\\img\\default.png`; if (process.platform === 'linux') { - defaultFile.replace('\\', '/'); + defaultFile.replace(/\\/g, '/'); } // this very randomly fails sometimes @@ -34,7 +34,7 @@ function Get(req, res) { // if linux const file = `${process.cwd()}\\db\\img\\${bucket[0]}\\${bucket[1]}\\${bucket[2]}\\${bucket[3]}\\${id}`; if (process.platform === 'linux') { - file.replace('\\', '/'); + file.replace(/\\/g, '/'); } if (fs.existsSync(file)) {