Comparing version 2.1.0 to 2.1.1
@@ -126,4 +126,5 @@ "use strict"; | ||
this.app.use('/server/:port/', (req, res, next) => { | ||
var _a; | ||
const serverPort = Number(req.params.port); | ||
const serverRouter = this.servers[serverPort].router; | ||
const serverRouter = (_a = this.servers[serverPort]) === null || _a === void 0 ? void 0 : _a.router; | ||
if (!serverRouter) { | ||
@@ -152,3 +153,3 @@ res.status(404).send('Unknown mock server'); | ||
this.server.on('upgrade', (req, socket, head) => __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b; | ||
var _a, _b, _c; | ||
const reqOrigin = req.headers['origin']; | ||
@@ -167,3 +168,3 @@ if (this.requiredOrigin && !(yield strictOriginMatch(reqOrigin, this.requiredOrigin))) { | ||
? (_b = (_a = this.servers[port]) === null || _a === void 0 ? void 0 : _a.subscriptionServer) === null || _b === void 0 ? void 0 : _b.wsServer | ||
: this.servers[port].streamServer; | ||
: (_c = this.servers[port]) === null || _c === void 0 ? void 0 : _c.streamServer; | ||
if (wsServer) { | ||
@@ -170,0 +171,0 @@ wsServer.handleUpgrade(req, socket, head, (ws) => { |
{ | ||
"name": "mockttp", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Mock HTTP server for testing HTTP clients and stubbing webservices", | ||
@@ -5,0 +5,0 @@ "main": "dist/main.js", |
@@ -163,3 +163,3 @@ /** | ||
const serverPort = Number(req.params.port); | ||
const serverRouter = this.servers[serverPort].router; | ||
const serverRouter = this.servers[serverPort]?.router; | ||
@@ -214,3 +214,3 @@ if (!serverRouter) { | ||
? (<any> this.servers[port]?.subscriptionServer)?.wsServer | ||
: this.servers[port].streamServer; | ||
: this.servers[port]?.streamServer; | ||
@@ -217,0 +217,0 @@ if (wsServer) { |
Sorry, the diff of this file is not supported yet
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
939930
16826