mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
bugfix: Fix bad paren placement in /javascript
handler (#4496)
* Fix bad paren placement in `/javascript` handler
This fixes a bug introduced in commit
ed5a635f4c
.
* add regression test for #4495
* Move `/javascript` test to `specialpages.js`
Co-authored-by: webzwo0i <webzwo0i@c3d2.de>
This commit is contained in:
parent
07bcbbd404
commit
a05e8198c9
2 changed files with 26 additions and 1 deletions
|
@ -20,7 +20,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
||||||
//serve javascript.html
|
//serve javascript.html
|
||||||
args.app.get('/javascript', function(req, res)
|
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}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
25
tests/backend/specs/specialpages.js
Normal file
25
tests/backend/specs/specialpages.js
Normal file
|
@ -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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in a new issue