Skip to content

Warning - request header X-Hub-Signature not present or invalid #7

@Lorentzen1337

Description

@Lorentzen1337

Using the heroku example results in the issue even though req.headers reveal the following:
'x-hub-signature': 'sha1=XXXXXXXXXXXXXXXXXXXXXXXXXX'

I might however have found the issue:

app.use(bodyParser.json());
app.use(xhub({ algorithm: 'sha1', secret: process.env.APP_SECRET }));

Should be like this according to Express X-Hub README:

app.use(xhub({ algorithm: 'sha1', secret: process.env.APP_SECRET }));
app.use(bodyParser.json());

Because the README specifies that it should be added before bodyParser:

Then add the middleware to Express.js. It needs to be one of the first and before bodyParser().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions