Skip to content

Commit

Permalink
fix: POST, PUT and PATCH now always generate body on stub
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Siemon committed Feb 29, 2024
1 parent 01f4e34 commit 0176605
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/request-recorder/request-injector.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export default (() => {
getLast: () => ({
protocol: lastProtocol,
options: lastOptions,
body: lastBody.length === 0 ? undefined : lastBody.join('')
body: lastBody.length !== 0 || ['POST', 'PUT', 'PATCH'].includes(lastOptions.method)
? lastBody.join('')
: undefined
})
};
})();

0 comments on commit 0176605

Please sign in to comment.