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.
Files changed (2) hide show
  1. package/lib/proxy.js +4 -1
  2. 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(url, route.path)) {
560
+ if (route.path === '/' || startsWith(parsedUrl.pathname, route.path)) {
558
561
  return route;
559
562
  }
560
563
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tg-redbird",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "A reverse proxy with support for dynamic tables",
5
5
  "main": "index.js",
6
6
  "scripts": {