Skip to content

Commit

Permalink
Merge branch 'master' into global
Browse files Browse the repository at this point in the history
  • Loading branch information
legendecas authored May 18, 2020
2 parents ac6da8f + 637f982 commit 4682772
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/opentelemetry-plugin-http/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ export class HttpPlugin extends BasePlugin<Http> {
);

if (utils.isOpenTelemetryRequest(optionsParsed)) {
// clone the headers so delete will not modify the user's object
optionsParsed.headers = Object.assign({}, optionsParsed.headers);
delete optionsParsed.headers[utils.OT_REQUEST_HEADER];
return original.apply(this, [optionsParsed, ...args]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ describe('HttpPlugin', () => {
const spans = memoryExporter.getFinishedSpans();
assert.strictEqual(result.data, 'Ok');
assert.strictEqual(spans.length, 0);
assert.strictEqual(options.headers[OT_REQUEST_HEADER], 1);
});
});
describe('with good plugin options', () => {
Expand Down

0 comments on commit 4682772

Please sign in to comment.