http-proxy-middleware
Advanced tools
Comparing version 0.20.0-beta.1 to 0.20.0-beta.2
@@ -22,2 +22,3 @@ "use strict"; | ||
this.logger = logger_1.getInstance(); | ||
this.wsInternalSubscribed = false; | ||
// https://github.com/Microsoft/TypeScript/wiki/'this'-in-TypeScript#red-flags-for-this | ||
@@ -38,3 +39,6 @@ this.middleware = (req, res, next) => __awaiter(this, void 0, void 0, function* () { | ||
this.catchUpgradeRequest = server => { | ||
server.once('upgrade', this.handleUpgrade); | ||
server.on('upgrade', this.handleUpgrade); | ||
// prevent duplicate upgrade handling; | ||
// in case external upgrade is also configured | ||
this.wsInternalSubscribed = true; | ||
}; | ||
@@ -129,5 +133,9 @@ this.handleUpgrade = (req, socket, head) => { | ||
// expose function to upgrade externally | ||
this.middleware.upgrade = this.handleUpgrade; | ||
this.middleware.upgrade = (req, socket, head) => { | ||
if (!this.wsInternalSubscribed) { | ||
this.handleUpgrade(req, socket, head); | ||
} | ||
}; | ||
} | ||
} | ||
exports.HttpProxyMiddleware = HttpProxyMiddleware; |
{ | ||
"name": "http-proxy-middleware", | ||
"version": "0.20.0-beta.1", | ||
"version": "0.20.0-beta.2", | ||
"description": "The one-liner node.js proxy middleware for connect, express and browser-sync", | ||
@@ -5,0 +5,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
50947
631