diff --git a/server/auth.js b/server/auth.js index 39b78c9c..e0e40961 100644 --- a/server/auth.js +++ b/server/auth.js @@ -16,8 +16,9 @@ module.exports = (config) => { function _middle(config, authentication, req, res, next) { const is = config('auth'); + const {originalUrl} = req; - if (!is || req.originalUrl.startsWith("/public/")) + if (!is || originalUrl.startsWith('/public/')) return next(); const success = () => next(); diff --git a/server/cloudcmd.spec.mjs b/server/cloudcmd.spec.mjs index 9fc4ce71..01629a92 100644 --- a/server/cloudcmd.spec.mjs +++ b/server/cloudcmd.spec.mjs @@ -186,12 +186,12 @@ test('cloudcmd: manifest.json', async (t) => { const options = { config, - }; - + }; + const {status} = await request.get('/public/manifest.json', { options, }); - + t.equal(status, 200, 'should return manifest.json even when authentication is enabled'); t.end(); });