You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@contrast/instrumentation

Package Overview
Dependencies
Maintainers
15
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

54

lib/http2.js

@@ -23,31 +23,35 @@ /*

function createPostHook(namePrefix, patchType, methods, around) {
return function post(data) {
const { result: server } = data;
const serverPrototype = server ? Object.getPrototypeOf(server) : null;
if (!serverPrototype) {
core.logger.error('Unable to patch server prototype, continue without instrumentation');
return;
}
methods.forEach((method) => {
patcher.patch(serverPrototype, method, {
name: `${namePrefix}.${method}`,
patchType,
around
});
});
};
}
return {
'http2'(opts) {
depHooks.resolve({ name: 'http2' }, (http2) => {
opts.patchObjects.forEach((obj) => {
const { methods, patchType, patchObjects } = obj;
methods.forEach((method) => {
patcher.patch(http2, method, {
name: `http2.${method}`,
patchType,
post(data) {
const { result: server } = data;
const serverPrototype = server ? Object.getPrototypeOf(server) : null;
opts.patchObjects.forEach(({ methods, patchType, around }) => {
patcher.patch(http2, 'createServer', {
name: 'http2.createServer',
patchType,
post: createPostHook('http2.Server.prototype', patchType, methods, around),
});
if (!serverPrototype) {
core.logger.error('Unable to patch server prototype, continue without instrumentation');
return;
}
patchObjects.forEach((obj) => {
const { name, methods, patchType, around } = obj;
methods.forEach((method) => {
patcher.patch(serverPrototype, method, {
name: `http2.${name}.${method}`,
patchType,
around
});
});
});
}
});
patcher.patch(http2, 'createSecureServer', {
name: 'http2.createSecureServer',
patchType,
post: createPostHook('http2.SecureServer.prototype', patchType, methods, around)
});

@@ -54,0 +58,0 @@ });

{
"name": "@contrast/instrumentation",
"version": "1.1.0",
"version": "1.1.1",
"description": "Shared hooks and patches between Protect and Assess components",

@@ -19,2 +19,2 @@ "license": "SEE LICENSE IN LICENSE",

}
}
}
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc