Socket
Socket
Sign inDemoInstall

mockttp

Package Overview
Dependencies
Maintainers
1
Versions
124
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 3.15.1 to 3.15.2

18

dist/rules/requests/request-handlers.js

@@ -812,2 +812,20 @@ "use strict";

})().catch(reject)).catch((e) => {
if (!e.code && e.stack?.split('\n')[1]?.includes('node:internal/tls/secure-context')) {
// OpenSSL can throw all sorts of weird & wonderful errors here, and rarely exposes a
// useful error code from them. To handle that, we try to detect the most common cases,
// notable including the useless but common 'unsupported' error that covers all
// OpenSSL-unsupported (e.g. legacy) configurations.
let tlsErrorTag;
if (e.message === 'unsupported') {
e.code = 'ERR_TLS_CONTEXT_UNSUPPORTED';
tlsErrorTag = 'context-unsupported';
e.message = 'Unsupported TLS configuration';
}
else {
e.code = 'ERR_TLS_CONTEXT_UNKNOWN';
tlsErrorTag = 'context-unknown';
e.message = `TLS context error: ${e.message}`;
}
clientRes.tags.push(`passthrough-tls-error:${tlsErrorTag}`);
}
// All errors anywhere above (thrown or from explicit reject()) should end up here.

@@ -814,0 +832,0 @@ // We tag the response with the error code, for debugging from events:

2

package.json
{
"name": "mockttp",
"version": "3.15.1",
"version": "3.15.2",
"description": "Mock HTTP server for testing HTTP clients and stubbing webservices",

@@ -5,0 +5,0 @@ "exports": {

@@ -1130,2 +1130,22 @@ import _ = require('lodash');

).catch((e: ErrorLike) => {
if (!e.code && e.stack?.split('\n')[1]?.includes('node:internal/tls/secure-context')) {
// OpenSSL can throw all sorts of weird & wonderful errors here, and rarely exposes a
// useful error code from them. To handle that, we try to detect the most common cases,
// notable including the useless but common 'unsupported' error that covers all
// OpenSSL-unsupported (e.g. legacy) configurations.
let tlsErrorTag: string;
if (e.message === 'unsupported') {
e.code = 'ERR_TLS_CONTEXT_UNSUPPORTED';
tlsErrorTag = 'context-unsupported';
e.message = 'Unsupported TLS configuration';
} else {
e.code = 'ERR_TLS_CONTEXT_UNKNOWN';
tlsErrorTag = 'context-unknown';
e.message = `TLS context error: ${e.message}`;
}
clientRes.tags.push(`passthrough-tls-error:${tlsErrorTag}`);
}
// All errors anywhere above (thrown or from explicit reject()) should end up here.

@@ -1132,0 +1152,0 @@

Sorry, the diff of this file is not supported yet

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