Skip to content

Commit

Permalink
[fix] Fix incorrect depth check.
Browse files Browse the repository at this point in the history
  • Loading branch information
AvianFlu committed Nov 17, 2011
1 parent c03a450 commit 3ab02f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/node-http-proxy/proxy-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, '');
Expand Down Expand Up @@ -170,4 +170,4 @@ ProxyTable.prototype.close = function () {
if (typeof this.routeFile === 'string') {
fs.unwatchFile(this.routeFile);
}
};
};

0 comments on commit 3ab02f3

Please sign in to comment.