Skip to content

Commit

Permalink
Add raw body in request object accessible by req.rawBody
Browse files Browse the repository at this point in the history
  • Loading branch information
Devilmaydante committed Nov 3, 2023
1 parent faa92ce commit 6914111
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/services/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,14 @@ const initMiddleware = (app) => {
extended: true,
}),
);
app.use(bodyParser.json(config.bodyParser));
app.use(
bodyParser.json({
...config.bodyParser,
verify: (req, res, buf) => {
req.rawBody = buf;
},
}),
);
app.use(methodOverride());
// Add the cookie parser and flash middleware
app.use(cookieParser());
Expand Down

0 comments on commit 6914111

Please sign in to comment.