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

This commit is contained in:
Julian Lam
2017-10-10 12:17:39 -04:00
parent 72502ff992
commit df5178ce78

View File

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