Skip to content

Commit 3ab02f3

Browse files
committed
[fix] Fix incorrect depth check.
1 parent c03a450 commit 3ab02f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/node-http-proxy/proxy-table.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ ProxyTable.prototype.getProxyLocation = function (req) {
140140

141141
var pathSegments = route.path.split('/');
142142

143-
if (pathSegments.length > 0) {
143+
if (pathSegments.length > 1) {
144144
// don't include the proxytable path segments in the proxied request url
145145
pathSegments = new RegExp("/" + pathSegments.slice(1).join('/'));
146146
req.url = req.url.replace(pathSegments, '');
@@ -170,4 +170,4 @@ ProxyTable.prototype.close = function () {
170170
if (typeof this.routeFile === 'string') {
171171
fs.unwatchFile(this.routeFile);
172172
}
173-
};
173+
};

0 commit comments

Comments
 (0)