Skip to content

Commit

Permalink
feat: Don't stringify string body
Browse files Browse the repository at this point in the history
  • Loading branch information
nicola-smartive committed Jun 18, 2024
1 parent 2bb9e2d commit 67d6cb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ app.all('*', (req, res) => {
calls.push(call);
}

const stringifiedBody = JSON.stringify(req.body, null, 2);
const stringifiedBody = typeof req.body === 'string' ? req.body : JSON.stringify(req.body, null, 2);
for (const route of routes) {
if (
new RegExp(`^${route.request.match}$`).test(req.url) &&
Expand Down

0 comments on commit 67d6cb2

Please sign in to comment.