mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
fix: cloudcmd: make manifest.json accessible when authentication is enabled (#428)
* Make manifest.json accessable when authentication is enabled * add test for manifest.json availability when authentication is enabled
This commit is contained in:
parent
03e3ba6ad8
commit
dff0267239
4 changed files with 19 additions and 2 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue