http-proxy-middleware
Advanced tools
Comparing version 3.0.2 to 3.0.3
@@ -8,2 +8,3 @@ import type { RequestHandler, Options } from './types'; | ||
private pathRewriter; | ||
private logger; | ||
constructor(options: Options<TReq, TRes>); | ||
@@ -10,0 +11,0 @@ middleware: RequestHandler; |
@@ -12,2 +12,3 @@ "use strict"; | ||
const function_1 = require("./utils/function"); | ||
const logger_1 = require("./logger"); | ||
class HttpProxyMiddleware { | ||
@@ -73,3 +74,10 @@ constructor(options) { | ||
this.shouldProxy = (pathFilter, req) => { | ||
return (0, path_filter_1.matchPathFilter)(pathFilter, req.url, req); | ||
try { | ||
return (0, path_filter_1.matchPathFilter)(pathFilter, req.url, req); | ||
} | ||
catch (err) { | ||
(0, debug_1.Debug)('Error: matchPathFilter() called with request url: ', `"${req.url}"`); | ||
this.logger.error(err); | ||
return false; | ||
} | ||
}; | ||
@@ -127,2 +135,3 @@ /** | ||
this.proxyOptions = options; | ||
this.logger = (0, logger_1.getLogger)(options); | ||
(0, debug_1.Debug)(`create proxy server`); | ||
@@ -129,0 +138,0 @@ this.proxy = httpProxy.createProxyServer({}); |
{ | ||
"name": "http-proxy-middleware", | ||
"type": "commonjs", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "The one-liner node.js proxy middleware for connect, express, next.js and more", | ||
@@ -6,0 +6,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81388
1352