Skip to content
This repository has been archived by the owner on Aug 26, 2020. It is now read-only.

Express framework does not support case sensitive signature header key #1

Open
dpmex4527 opened this issue Sep 22, 2015 · 0 comments
Open

Comments

@dpmex4527
Copy link

dpmex4527 commented Sep 22, 2015

I noticed that the express framework used by hubot (router.post) does not support the case sensitive "X-Hub-Signature" or "X-Github-Delivery" keys. I kept getting undefined errors when referencing the repo_event.signature value. As soon as I changed it all to lowercase (much like the x-github-event key you use) it works like a charm.

  eventBody =
    eventType   : req.headers["x-github-event"]
    signature   : req.headers["X-Hub-Signature"]
    deliveryId  : req.headers["X-Github-Delivery"]
    payload     : req.body
    query       : querystring.parse(url.parse(req.url).query)

^ does not work with signatures nor deliveryID

  eventBody =
    eventType   : req.headers["x-github-event"]
    signature   : req.headers["x-hub-signature"] <- all lower case
    deliveryId  : req.headers["x-github-delivery"] <- all lower case
    payload     : req.body
    query       : querystring.parse(url.parse(req.url).query)

^ This does work

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant