Getting raw body for HMAC-SHA256

  • My NodeBB plugin exposes a webhook where I receive requests from another service that I don't have control over. This service sends a POST request that contains a header which is an HMAC-SHA256 hash of the raw BODY, where the key is provided by this service directly in my account.

    Right now in NodeBB v1.13.1, the only way that I found to retrieve this raw BODY is by directly modifying src/webserver.js by adding the following before configureBodyParser(app):

    app.use('/webhook', bodyParser.text({ type: '*/*' }));

    Is there a better way of doing this without modifying NodeBB's source code?

Log in to reply

Suggested Topics

| |