diff --git a/html/index.html b/html/index.html index 353d6a83..0c374b9c 100644 --- a/html/index.html +++ b/html/index.html @@ -9,7 +9,7 @@ - + diff --git a/static/manifest.json b/public/manifest.json similarity index 100% rename from static/manifest.json rename to public/manifest.json diff --git a/server/auth.js b/server/auth.js index 60a3fda5..39b78c9c 100644 --- a/server/auth.js +++ b/server/auth.js @@ -17,7 +17,7 @@ module.exports = (config) => { function _middle(config, authentication, req, res, next) { const is = config('auth'); - if (!is) + if (!is || req.originalUrl.startsWith("/public/")) return next(); const success = () => next(); diff --git a/server/cloudcmd.spec.mjs b/server/cloudcmd.spec.mjs index 96b865b4..9fc4ce71 100644 --- a/server/cloudcmd.spec.mjs +++ b/server/cloudcmd.spec.mjs @@ -178,3 +178,20 @@ test('cloudcmd: sw', async (t) => { t.equal(status, 200, 'should return sw'); t.end(); }); + +test('cloudcmd: manifest.json', async (t) => { + const config = { + auth: true, + }; + + 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(); +});