Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('prevents xss in query validation response message', (done) => {
const server = new Hapi.Server();
server.connection();
server.route({
method: 'GET', path: '/fail/query', handler: function (request, reply) {
return reply('Success');
},
config: {
validate: { query: { name: Joi.string() } }
}
});
server.inject({
method: 'GET',
url: '/fail/query?=value'
},
(res) => {
expect(res.result.message).to.not.contain('