From 3cb3f8094f42bf1a743d290283c0feb372f0f522 Mon Sep 17 00:00:00 2001 From: lohit Date: Mon, 16 Sep 2024 17:13:19 +0530 Subject: [PATCH] chore: disableParsingResponseJson shim fn in safe mode (#3110) --- .../bruno-js/src/sandbox/quickjs/shims/bruno-request.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/bruno-js/src/sandbox/quickjs/shims/bruno-request.js b/packages/bruno-js/src/sandbox/quickjs/shims/bruno-request.js index 9be27fae7..1edfaaadb 100644 --- a/packages/bruno-js/src/sandbox/quickjs/shims/bruno-request.js +++ b/packages/bruno-js/src/sandbox/quickjs/shims/bruno-request.js @@ -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(); };