diff --git a/packages/node_modules/@node-red/nodes/core/network/21-httpin.js b/packages/node_modules/@node-red/nodes/core/network/21-httpin.js index 1c67b3bc7..009f6d088 100644 --- a/packages/node_modules/@node-red/nodes/core/network/21-httpin.js +++ b/packages/node_modules/@node-red/nodes/core/network/21-httpin.js @@ -71,11 +71,11 @@ module.exports = function(RED) { }); } - function getRootRouter(app) { + function getRootApp(app) { if (typeof app.parent === 'undefined') { return app; } - return getRootRouter(app.parent) + return getRootApp(app.parent) } function createRouteId(req) { @@ -83,7 +83,7 @@ module.exports = function(RED) { return `${method}:${url}`; } - var rootApp = getRootRouter(RED.httpNode) + var rootApp = getRootApp(RED.httpNode) // Check if middleware already exists var isMiddlewarePresent = rootApp._router.stack.some(layer => layer.name === 'setupRawBodyCapture') @@ -352,10 +352,10 @@ module.exports = function(RED) { RED.httpNode.delete(this.url, cookieParser(), httpMiddleware, corsHandler, metricsHandler, jsonParser, urlencParser, rawBodyParser, this.callback, this.errorHandler); } - // unique id for httpInNodeSettings based on method name and url path + // unique id for httpInNode based on method name and url path var httpInNodeId = createRouteId({url: this.url, method: this.method}) - // get httpInNodeSettings from RED.httpNode + // get httpInNode from RED.httpNode var httpInNodes = rootApp.get('httpInNodes') // Add httpInNode to RED.httpNode