Comparing version 0.5.3 to 0.5.4
@@ -1,1 +0,1 @@ | ||
module.exports = '0.5.3' | ||
module.exports = '0.5.4' |
{ | ||
"name": "dd-trace", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "Datadog APM tracing client for JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -115,6 +115,9 @@ 'use strict' | ||
if (headers['x-amz-signature'] || | ||
(headers['authorization'] && headers['authorization'].startsWith('AWS4-HMAC-SHA256'))) { | ||
if (headers['x-amz-signature']) { | ||
return true | ||
} | ||
if ([].concat(headers['authorization']).some(startsWith('AWS4-HMAC-SHA256'))) { | ||
return true | ||
} | ||
} | ||
@@ -125,2 +128,6 @@ | ||
function startsWith (searchString) { | ||
return value => String(value).startsWith(searchString) | ||
} | ||
function unpatch (http) { | ||
@@ -127,0 +134,0 @@ this.unwrap(http, 'request') |
@@ -208,2 +208,32 @@ 'use strict' | ||
it('should skip injecting if one of the Authorization headers contains an AWS signature', done => { | ||
const app = express() | ||
app.get('/', (req, res) => { | ||
try { | ||
expect(req.get('x-datadog-trace-id')).to.be.undefined | ||
expect(req.get('x-datadog-parent-id')).to.be.undefined | ||
res.status(200).send() | ||
done() | ||
} catch (e) { | ||
done(e) | ||
} | ||
}) | ||
getPort().then(port => { | ||
appListener = app.listen(port, 'localhost', () => { | ||
const req = http.request({ | ||
port, | ||
headers: { | ||
Authorization: ['AWS4-HMAC-SHA256 ...'] | ||
} | ||
}) | ||
req.end() | ||
}) | ||
}) | ||
}) | ||
it('should skip injecting if the X-Amz-Signature header is set', done => { | ||
@@ -210,0 +240,0 @@ const app = express() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
292486
8306