Skip to content

Commit

Permalink
Send a 403 response when the token is invalid. As per FB provided exa…
Browse files Browse the repository at this point in the history
…mples.
  • Loading branch information
Ali Lokhandwala committed Aug 16, 2016
1 parent bb592fb commit a6837fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Botly.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
});

Expand Down
1 change: 1 addition & 0 deletions test/botly_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

});
Expand Down

0 comments on commit a6837fa

Please sign in to comment.