handle options in getBody for QuickJS VM (#4614)

This commit is contained in:
anusree-bruno
2025-10-19 01:02:30 +05:30
committed by GitHub
parent ad2add4026
commit 81e1e403e4

View File

@@ -87,9 +87,10 @@ const addBrunoRequestShimToContext = (vm, req) => {
vm.setProp(reqObject, 'setHeader', setHeader);
setHeader.dispose();
let getBody = vm.newFunction('getBody', function () {
return marshallToVm(req.getBody(), vm);
let getBody = vm.newFunction('getBody', function (options) {
return marshallToVm(req.getBody(vm.dump(options)), vm);
});
vm.setProp(reqObject, 'getBody', getBody);
getBody.dispose();