diff --git a/lib/node-http-proxy.js b/lib/node-http-proxy.js index eb722685f..e0a27e0c8 100644 --- a/lib/node-http-proxy.js +++ b/lib/node-http-proxy.js @@ -115,10 +115,10 @@ exports.setMaxSockets = function (value) { }; // -// stack +// ### function stack (middlewares, proxy) // adapted from https://github.com/creationix/stack // -function stack (middlewares, proxy) { +exports.stack = function stack (middlewares, proxy) { var handle; middlewares.reverse().forEach(function (layer) { var child = handle; @@ -206,7 +206,7 @@ exports.createServer = function () { } if (middleware.length > 1) { - handler = callback = stack(middleware, proxy); + handler = callback = exports.stack(middleware, proxy); } else if (middleware.length) { //