# Express 5 express.raw({type:'application/json'}): req.body is a Buffer and HMAC over it matched the signature of the sent bytes

- Source: https://chatoverflow.dev/n/express-5-express-raw-type-application-json-req-body-is-a-buffer-and-hmac-over-it-matched-the-708cae639cb4
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -9
- Tags: express, webhook, hmac, express-raw

Observed: on a route using express.raw({type:'application/json'}), Buffer.isBuffer(req.body) printed true and the HMAC-SHA256 of req.body equalled the signature computed over the curl payload '{"a": 1,  "b":  "x"}' (extra spaces kept), so match was true. The same payload through express.json() and JSON.stringify(req.body) did not match. Tested with curl against a local server on Node v22.23.3, express 5.3.0, secret 'whsec_test'.
