Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@instana/core

Package Overview
Dependencies
Maintainers
3
Versions
258
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@instana/core - npm Package Compare versions

Comparing version 1.74.2 to 1.75.0

10

package.json
{
"name": "@instana/core",
"version": "1.74.2",
"version": "1.75.0",
"description": "Core library for Instana's Node.js packages",

@@ -14,7 +14,7 @@ "main": "src/index.js",

"audit": "npm audit --production",
"test": "npm run test:nolint && npm run test:lint",
"test:nolint": "NODE_ENV=debug USE_OPENTRACING_DEBUG_IMPL=true npm run test:mocha",
"test": "NODE_ENV=debug USE_OPENTRACING_DEBUG_IMPL=true npm run test:mocha",
"test:mocha": "mocha --reporter spec $(find test -name '*test.js')",
"test:debug": "WITH_STDOUT=true npm run test:mocha",
"test:lint": "eslint src test",
"lint": "eslint src test",
"verify": "npm run lint && npm test",
"prettier": "prettier --write 'src/**/*.js' 'test/**/*.js' 'bin/**/*.js'"

@@ -136,3 +136,3 @@ },

},
"gitHead": "de6e7ec86045ab2482587d2564d36d4ee836b6ee"
"gitHead": "d127eb54c91c658eca2a390a10ff6cda6d5f679b"
}
'use strict';
exports.getExtraHeaders = function getExtraHeaders(incomingMessage, extraHttpHeadersToCapture) {
exports.getExtraHeaders = function getExtraHeaders(message, extraHttpHeadersToCapture) {
if (!extraHttpHeadersToCapture || extraHttpHeadersToCapture.length === 0) {

@@ -8,11 +8,47 @@ return undefined;

var extraHeadersFound = false;
var extraHeaders = {};
for (var i = 0; i < extraHttpHeadersToCapture.length; i++) {
var key = extraHttpHeadersToCapture[i];
var value = incomingMessage.headers[key];
var value = message.headers[key];
if (value) {
extraHeaders[key] = value;
extraHeadersFound = true;
}
}
if (!extraHeadersFound) {
return undefined;
}
return extraHeaders;
};
exports.mergeExtraHeaders = function mergeExtraHeaders(
headersAlreadyCapturedIfAny,
message,
extraHttpHeadersToCapture
) {
if (!extraHttpHeadersToCapture || extraHttpHeadersToCapture.length === 0) {
return headersAlreadyCapturedIfAny;
}
var additionalHeadersFound = false;
var additionalHeaders = {};
for (var i = 0; i < extraHttpHeadersToCapture.length; i++) {
var key = extraHttpHeadersToCapture[i];
var value = message.getHeader(key);
if (value) {
additionalHeaders[key] = value;
additionalHeadersFound = true;
}
}
if (!additionalHeadersFound) {
additionalHeaders = undefined;
}
if (headersAlreadyCapturedIfAny && additionalHeaders) {
return Object.assign(headersAlreadyCapturedIfAny, additionalHeaders);
} else if (additionalHeaders) {
return additionalHeaders;
}
return headersAlreadyCapturedIfAny;
};

@@ -105,2 +105,3 @@ 'use strict';

span.data.http.status = res.statusCode;
span.data.http.header = httpCommon.mergeExtraHeaders(span.data.http.header, res, extraHttpHeadersToCapture);
span.error = res.statusCode >= 500;

@@ -107,0 +108,0 @@ span.ec = span.error ? 1 : 0;

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