From 3ab02f3ad7f2c59d73c621695eb238233c16d09c Mon Sep 17 00:00:00 2001 From: Charlie McConnell Date: Wed, 16 Nov 2011 19:15:45 -0800 Subject: [PATCH] [fix] Fix incorrect depth check. --- lib/node-http-proxy/proxy-table.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node-http-proxy/proxy-table.js b/lib/node-http-proxy/proxy-table.js index d93f082f4..0cdce50a5 100644 --- a/lib/node-http-proxy/proxy-table.js +++ b/lib/node-http-proxy/proxy-table.js @@ -140,7 +140,7 @@ ProxyTable.prototype.getProxyLocation = function (req) { var pathSegments = route.path.split('/'); - if (pathSegments.length > 0) { + if (pathSegments.length > 1) { // don't include the proxytable path segments in the proxied request url pathSegments = new RegExp("/" + pathSegments.slice(1).join('/')); req.url = req.url.replace(pathSegments, ''); @@ -170,4 +170,4 @@ ProxyTable.prototype.close = function () { if (typeof this.routeFile === 'string') { fs.unwatchFile(this.routeFile); } -}; \ No newline at end of file +};