Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'Failed to JSON.parse agent response. Response was %s. Will retry in %sms',
rawResponse,
retryDelay,
e
);
setTimeout(tryToAnnounce, retryDelay, ctx).unref();
return;
}
var pid = response.pid;
logger.info('Overwriting pid for reporting purposes to: %s', pid);
pidStore.pid = pid;
agentOpts.agentUuid = response.agentUuid;
if (Array.isArray(response.extraHeaders)) {
tracing.setExtraHttpHeadersToCapture(
response.extraHeaders.map(function(s) {
// Node.js HTTP API turns all incoming HTTP headers into lowercase.
return s.toLowerCase();
})
);
}
if (response.secrets) {
if (!(typeof response.secrets.matcher === 'string')) {
logger.warn(
'Received invalid secrets configuration from agent, attribute matcher is not a string: $s',
response.secrets.matcher
);
} else if (Object.keys(secrets.matchers).indexOf(response.secrets.matcher) < 0) {
logger.warn(
'Received invalid secrets configuration from agent, matcher is not supported: $s',