mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
PR changes
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
const StopTheBleed = require('../../StopTheBleed')
|
||||
const PayloadValidator = require('../../PayloadValidator')
|
||||
|
||||
module.exports = function(RED) {
|
||||
"use strict";
|
||||
@@ -209,13 +209,12 @@ module.exports = function(RED) {
|
||||
try {
|
||||
this.on("input", function(msg) {
|
||||
try {
|
||||
const stopTheBleed = new StopTheBleed(msg)
|
||||
const payloadValidator = new PayloadValidator(msg)
|
||||
var start = process.hrtime();
|
||||
sandbox.msg = msg;
|
||||
const vm2Instance = new vm2.VM({ sandbox, timeout: 5000 });
|
||||
const result = vm2Instance.run(functionText);
|
||||
console.log('before the bleed check')
|
||||
stopTheBleed.verify(result)
|
||||
payloadValidator.verify(result)
|
||||
sendResults(this,msg._msgid, result);
|
||||
|
||||
var duration = process.hrtime(start);
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
const StopTheBleed = require('../../StopTheBleed')
|
||||
const PayloadValidator = require('../../PayloadValidator')
|
||||
|
||||
module.exports = function(RED) {
|
||||
"use strict";
|
||||
@@ -229,7 +229,7 @@ module.exports = function(RED) {
|
||||
}
|
||||
if (valid) {
|
||||
this.on('input', function(msg) {
|
||||
const stopTheBleed = new StopTheBleed(msg)
|
||||
const payloadValidator = new PayloadValidator(msg)
|
||||
for (var i=0; i<this.rules.length; i++) {
|
||||
if (this.rules[i].t === "move") {
|
||||
var r = this.rules[i];
|
||||
@@ -250,7 +250,7 @@ module.exports = function(RED) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
stopTheBleed.verify(msg)
|
||||
payloadValidator.verify(msg)
|
||||
node.send(msg);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user