chore: disableParsingResponseJson shim fn in safe mode (#3110)

This commit is contained in:
lohit 2024-09-16 17:13:19 +05:30 committed by GitHub
parent 4f7cefe41d
commit 3cb3f8094f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -105,6 +105,12 @@ const addBrunoRequestShimToContext = (vm, req) => {
vm.setProp(reqObject, 'setTimeout', setTimeout);
setTimeout.dispose();
let disableParsingResponseJson = vm.newFunction('disableParsingResponseJson', function () {
req.disableParsingResponseJson();
});
vm.setProp(reqObject, 'disableParsingResponseJson', disableParsingResponseJson);
disableParsingResponseJson.dispose();
vm.setProp(vm.global, 'req', reqObject);
reqObject.dispose();
};