Socket
Socket
Sign inDemoInstall

mockttp

Package Overview
Dependencies
Maintainers
1
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mockttp - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

7

dist/standalone/mockttp-standalone.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc