Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Executes Javascript, Typescript Scripts.
<!--
### **WORK IN PROGRESS**
-->

### **WORK IN PROGRESS**
* (foxriver76) added fallback to require the adapters `request` module if no own installed

### 8.7.3 (2024-07-25)
* (@klein0r) Fixed script deletion (icon was missing)
* (@klein0r) Fixed some translations and Blockly definitions
Expand Down
9 changes: 7 additions & 2 deletions lib/sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,16 @@ function sandBox(script, name, verbose, debug, context) {
md = md.replace(/^node:/, '');
}

if (typeof md === 'string') {
if (md === 'request' && !sandbox.__engine.__deprecatedWarnings.includes(md)) {
if (md === 'request') {
if (!sandbox.__engine.__deprecatedWarnings.includes(md)) {
sandbox.log(`request package is deprecated - please use httpGet (or a stable lib like axios) instead!`, 'warn');
sandbox.__engine.__deprecatedWarnings.push(md);
}

if (!mods[md]) {
// for backward compatibility we require the adapters own request module as back in the days this module did not need to be specified in the additional npm modules
mods[md] = require(md);
}
}

if (mods[md]) {
Expand Down