fixed typo in outgoing route test, and added new test for javascript protocol

v1.18.x
Julian Lam 8 years ago
parent 72502ff992
commit df5178ce78

@ -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) {

Loading…
Cancel
Save