1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix http in node close wrinkle if cors enabled but not used.

This commit is contained in:
Dave C-J 2014-10-29 18:26:09 +00:00
parent 98b875c4a0
commit a1830def8e

View File

@ -95,6 +95,7 @@ module.exports = function(RED) {
} }
if (RED.settings.httpNodeCors) { if (RED.settings.httpNodeCors) {
var route = RED.httpNode.route['options']; var route = RED.httpNode.route['options'];
if (route) {
for (var j = 0; j<route.length; j++) { for (var j = 0; j<route.length; j++) {
if (route[j].path == this.url) { if (route[j].path == this.url) {
route.splice(j,1); route.splice(j,1);
@ -102,6 +103,7 @@ module.exports = function(RED) {
} }
} }
} }
}
}); });
} else { } else {
this.warn("Cannot create http-in node when httpNodeRoot set to false"); this.warn("Cannot create http-in node when httpNodeRoot set to false");