http-proxy-middleware 2.0.7-beta.0 → 2.0.7-beta.1

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.
@@ -73,8 +73,14 @@ class HttpProxyMiddleware {
73
73
  * @return {Boolean}
74
74
  */
75
75
  this.shouldProxy = (context, req) => {
76
- const path = req.originalUrl || req.url;
77
- return contextMatcher.match(context, path, req);
76
+ try {
77
+ const path = req.originalUrl || req.url;
78
+ return contextMatcher.match(context, path, req);
79
+ }
80
+ catch (error) {
81
+ this.logger.error(error);
82
+ return false;
83
+ }
78
84
  };
79
85
  /**
80
86
  * Apply option.router and option.pathRewrite
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "http-proxy-middleware",
3
- "version": "2.0.7-beta.0",
3
+ "version": "2.0.7-beta.1",
4
4
  "description": "The one-liner node.js proxy middleware for connect, express and browser-sync",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",