mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-29 23:54:24 +00:00
add scripts context to response scripts
This commit is contained in:
committed by
Anoop M D
parent
592679538b
commit
0591530d44
@@ -193,6 +193,11 @@ class ScriptRuntime {
|
||||
const res = new BrunoResponse(response);
|
||||
const allowScriptFilesystemAccess = get(scriptingConfig, 'filesystemAccess.allow', false);
|
||||
const moduleWhitelist = get(scriptingConfig, 'moduleWhitelist', []);
|
||||
const additionalContextRoots = get(scriptingConfig, 'additionalContextRoots', []);
|
||||
const additionalContextRootsAbsolute = lodash
|
||||
.chain(additionalContextRoots)
|
||||
.map((acr) => (acr.startsWith('/') ? acr : path.join(collectionPath, acr)))
|
||||
.value();
|
||||
|
||||
const whitelistedModules = {};
|
||||
|
||||
@@ -255,7 +260,7 @@ class ScriptRuntime {
|
||||
context: 'sandbox',
|
||||
builtin: [ "*" ],
|
||||
external: true,
|
||||
root: [collectionPath],
|
||||
root: [collectionPath, ...additionalContextRootsAbsolute],
|
||||
mock: {
|
||||
// node libs
|
||||
path,
|
||||
|
||||
Reference in New Issue
Block a user