Skip to content

Commit

Permalink
Merge pull request #491 from stalleyj/https
Browse files Browse the repository at this point in the history
Fix https outbound probe for Node 8.9.0+
  • Loading branch information
hhellyer authored Nov 2, 2017
2 parents 8be6545 + 37c10d6 commit c4cc528
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions probes/https-outbound-probe.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ var request = require('../lib/request.js');

var url = require('url');
var util = require('util');

// In https 'get' calls 'request' so we only instrument 'request'
var methods = ['request'];
var semver = require('semver');

var methods;
// In Node.js < v8.9.0 'get' calls 'request' so we only instrument 'request'
if (semver.lt(process.version, '8.9.0')) {
methods = ['request'];
} else {
methods = ['request', 'get'];
}

// Probe to instrument outbound https requests

function HttpsOutboundProbe() {
Probe.call(this, 'https'); // match the name of the module we're instrumenting
}
Expand Down

0 comments on commit c4cc528

Please sign in to comment.