tg-redbird 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/proxy.js +4 -1
- package/package.json +1 -1
package/lib/proxy.js
CHANGED
@@ -542,6 +542,9 @@ ReverseProxy.prototype._defaultResolver = function (host, url) {
|
|
542
542
|
|
543
543
|
url = url || '/';
|
544
544
|
|
545
|
+
// When URL comes with query params, the default resolver may fail to get the correct route.
|
546
|
+
const parsedUrl = parseUrl(url)
|
547
|
+
|
545
548
|
var routes = this.routing[host];
|
546
549
|
var i = 0;
|
547
550
|
|
@@ -554,7 +557,7 @@ ReverseProxy.prototype._defaultResolver = function (host, url) {
|
|
554
557
|
for (i = 0; i < len; i++) {
|
555
558
|
var route = routes[i];
|
556
559
|
|
557
|
-
if (route.path === '/' || startsWith(
|
560
|
+
if (route.path === '/' || startsWith(parsedUrl.pathname, route.path)) {
|
558
561
|
return route;
|
559
562
|
}
|
560
563
|
}
|