Skip to content

Commit 7b18388

Browse files
authored
fix(bru-2096): handle options prop for req body apis in safe mode (#6001)
1 parent fa28ab9 commit 7b18388

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/bruno-js/src/sandbox/quickjs/shims/bruno-request.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ const addBrunoRequestShimToContext = (vm, req) => {
8787
vm.setProp(reqObject, 'setHeader', setHeader);
8888
setHeader.dispose();
8989

90-
let getBody = vm.newFunction('getBody', function (options) {
90+
let getBody = vm.newFunction('getBody', function (options = {}) {
9191
return marshallToVm(req.getBody(vm.dump(options)), vm);
9292
});
9393

9494
vm.setProp(reqObject, 'getBody', getBody);
9595
getBody.dispose();
9696

97-
let setBody = vm.newFunction('setBody', function (data) {
98-
req.setBody(vm.dump(data));
97+
let setBody = vm.newFunction('setBody', function (data, options = {}) {
98+
req.setBody(vm.dump(data), vm.dump(options));
9999
});
100100
vm.setProp(reqObject, 'setBody', setBody);
101101
setBody.dispose();

0 commit comments

Comments
 (0)