diff --git a/server/Server.js b/server/Server.js index 99e72d0c..1a8db406 100644 --- a/server/Server.js +++ b/server/Server.js @@ -240,7 +240,7 @@ class Server { * Running in development allows cors to allow testing the mobile apps in the browser * or env variable ALLOW_CORS = '1' */ - if (Logger.isDev || req.path.match(/\/api\/items\/([a-z0-9-]{36})\/(ebook|cover)(\/[0-9]+)?/)) { + if (global.AllowCors || Logger.isDev || req.path.match(/\/api\/items\/([a-z0-9-]{36})\/(ebook|cover)(\/[0-9]+)?/)) { const allowedOrigins = ['capacitor://localhost', 'http://localhost'] if (global.AllowCors || Logger.isDev || allowedOrigins.some((o) => o === req.get('origin'))) { res.header('Access-Control-Allow-Origin', req.get('origin'))