mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
fixed typo in outgoing route test, and added new test for javascript protocol
This commit is contained in:
@@ -216,7 +216,7 @@ describe('Controllers', function () {
|
||||
});
|
||||
|
||||
it('should load /outgoing?url=<url>', function (done) {
|
||||
request(nconf.get('url') + '/outgoing?url=http//youtube.com', function (err, res, body) {
|
||||
request(nconf.get('url') + '/outgoing?url=http://youtube.com', function (err, res, body) {
|
||||
assert.ifError(err);
|
||||
assert.equal(res.statusCode, 200);
|
||||
assert(body);
|
||||
@@ -233,6 +233,15 @@ describe('Controllers', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('should 404 on /outgoing with javascript: protocol', function (done) {
|
||||
request(nconf.get('url') + '/outgoing?url=javascript:alert(1);', function (err, res, body) {
|
||||
assert.ifError(err);
|
||||
assert.equal(res.statusCode, 404);
|
||||
assert(body);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should load /tos', function (done) {
|
||||
meta.config.termsOfUse = 'please accept our tos';
|
||||
request(nconf.get('url') + '/tos', function (err, res, body) {
|
||||
|
||||
Reference in New Issue
Block a user