mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
parent
85dafc0b3c
commit
aea5445495
@ -70,10 +70,13 @@ function requireModule(module) {
|
||||
e.code = "module_not_allowed";
|
||||
throw e;
|
||||
}
|
||||
if (BUILTIN_MODULES.indexOf(module) !== -1) {
|
||||
return require(module);
|
||||
|
||||
const parsedModule = parseModuleName(module);
|
||||
|
||||
if (BUILTIN_MODULES.indexOf(parsedModule.module) !== -1) {
|
||||
return require(parsedModule.module);
|
||||
}
|
||||
if (!knownExternalModules[module]) {
|
||||
if (!knownExternalModules[parsedModule.module]) {
|
||||
const e = new Error("Module not allowed");
|
||||
e.code = "module_not_allowed";
|
||||
throw e;
|
||||
|
Loading…
Reference in New Issue
Block a user