diff --git a/lib/Botly.js b/lib/Botly.js index 011b8f6..eb1f38a 100644 --- a/lib/Botly.js +++ b/lib/Botly.js @@ -64,7 +64,7 @@ Botly.prototype.router = function () { if (req.query['hub.verify_token'] === this.verifyToken) { res.send(req.query['hub.challenge']); } else { - res.send('Error, wrong validation token'); + res.status(403).send('Error, wrong validation token'); } }); diff --git a/test/botly_test.js b/test/botly_test.js index b602533..6061403 100644 --- a/test/botly_test.js +++ b/test/botly_test.js @@ -102,6 +102,7 @@ describe('Botly Tests', function () { }); router.handle(request, response); + expect(response.statusCode).to.equal(403); expect(response._getData()).to.equal('Error, wrong validation token'); });