diff --git a/src/node/hooks/express/specialpages.js b/src/node/hooks/express/specialpages.js index eb5c4a7fe..864d67995 100644 --- a/src/node/hooks/express/specialpages.js +++ b/src/node/hooks/express/specialpages.js @@ -20,7 +20,7 @@ exports.expressCreateServer = function (hook_name, args, cb) { //serve javascript.html args.app.get('/javascript', function(req, res) { - res.send(eejs.require('ep_etherpad-lite/templates/javascript.html'), {req}); + res.send(eejs.require('ep_etherpad-lite/templates/javascript.html', {req})); }); diff --git a/tests/backend/specs/specialpages.js b/tests/backend/specs/specialpages.js new file mode 100644 index 000000000..89f23bd9b --- /dev/null +++ b/tests/backend/specs/specialpages.js @@ -0,0 +1,25 @@ +const common = require('../common'); +const settings = require('ep_etherpad-lite/node/utils/Settings'); + +describe(__filename, function() { + let agent; + const backups = {}; + before(async function() { agent = await common.init(); }); + beforeEach(async function() { + backups.settings = {}; + for (const setting of ['requireAuthentication', 'requireAuthorization']) { + backups.settings[setting] = settings[setting]; + } + settings.requireAuthentication = false; + settings.requireAuthorization = false; + }); + afterEach(async function() { + Object.assign(settings, backups.settings); + }); + + describe('/javascript', function() { + it('/javascript -> 200', async function() { + await agent.get('/javascript').expect(200); + }); + }); +});