Skip to content

Commit

Permalink
Merge pull request miki2826#7 from wallali/master
Browse files Browse the repository at this point in the history
Send a 403 response when the token is invalid.
  • Loading branch information
miki2826 authored Aug 17, 2016
2 parents bb592fb + a6837fa commit 76cc9b6
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 76cc9b6

Please sign in to comment.