Skip to content

Commit f540fad

Browse files
committed
also check path matched req.url
1 parent cb5e084 commit f540fad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function getTargetFromProxyTable(req, table) {
2828
_.forIn(table, function(value, key) {
2929
if (containsPath(key)) {
3030

31-
if (hostAndPath.indexOf(key) > -1) { // match 'localhost:3000/api'
31+
if (hostAndPath.indexOf(key) == 0 || path.indexOf(key) == 0) { // match 'localhost:3000/api'
3232
result = table[key];
3333
logger.debug('[HPM] Router table match: "%s"', key);
3434
return false;

0 commit comments

Comments
 (0)