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

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

@dpmex4527

Description

@dpmex4527

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions