From 3834d6af338a96cb5d8b3121d618a9fe568f1dd7 Mon Sep 17 00:00:00 2001 From: Daniel Perez Date: Tue, 13 Oct 2015 12:34:47 -0500 Subject: [PATCH] made signature/deliveryId header fields lowercase Hubot doesn't seem to understand the case sensitive "X-Hub-Signature" or "X-Github-Delivery" header fields when listening to webhook events. Making them lowercase fixes this issue, of which you can then proceed to validate the sha1 hash to ensure that the event is coming from github. --- src/hubot-github-webhook-listener.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hubot-github-webhook-listener.coffee b/src/hubot-github-webhook-listener.coffee index 0e29962..7320a17 100644 --- a/src/hubot-github-webhook-listener.coffee +++ b/src/hubot-github-webhook-listener.coffee @@ -52,8 +52,8 @@ module.exports = (robot) -> robot.logger.info("Github post received: ", req) eventBody = eventType : req.headers["x-github-event"] - signature : req.headers["X-Hub-Signature"] - deliveryId : req.headers["X-Github-Delivery"] + signature : req.headers["x-hub-signature"] + deliveryId : req.headers["x-github-delivery"] payload : req.body query : querystring.parse(url.parse(req.url).query)