Skip to content

Commit

Permalink
fix: no longer rewriting body unnecessarily
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Siemon committed Dec 15, 2023
1 parent 179e148 commit 3198a1e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/modules/request-recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ export default (opts) => {
if (anyFlagPresent(['magic', 'body'])) {
const idx = pendingMocks.findIndex((m) => m.idx === scopeIdx);
const requestBody = tryParseJson(body);
pendingMocks[idx].record.body = nullAsString(requestBody);
const requestBodyStr = nullAsString(requestBody);
if (!isEqual(scope.body, requestBodyStr)) {
pendingMocks[idx].record.body = requestBodyStr;
}
return scope.body;
}
return body;
Expand Down

0 comments on commit 3198a1e

Please sign in to comment.