Skip to content

Commit

Permalink
fix(http): remove outgoing headers normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinjahn committed Jan 23, 2023
1 parent 9589d54 commit 3f203e3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
2 changes: 2 additions & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ All notable changes to experimental packages in this project will be documented

### :bug: (Bug Fix)

* fix(http) Remove outgoing headers normalization [#3557](https://github.com/open-telemetry/opentelemetry-js/pull/3557) @marcinjahn

### :books: (Refine Doc)

### :house: (Internal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,6 @@ export const getRequestInfo = (
origin = `${optionsParsed.protocol || 'http:'}//${hostname}`;
}

const headers = optionsParsed.headers ?? {};
optionsParsed.headers = Object.keys(headers).reduce(
(normalizedHeader, key) => {
normalizedHeader[key.toLowerCase()] = headers[key];
return normalizedHeader;
},
{} as OutgoingHttpHeaders
);
// some packages return method in lowercase..
// ensure upperCase for consistency
const method = optionsParsed.method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,11 +508,6 @@ describe('HttpInstrumentation', () => {
'user-agent': testValue,
},
}),
httpRequest.get(`${protocol}://${hostname}:${serverPort}`, {
headers: {
'uSeR-aGeNt': testValue,
},
}),
]);
const spans = memoryExporter.getFinishedSpans();
assert.strictEqual(spans.length, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,7 @@ describe('HttpsInstrumentation', () => {
headers: {
'user-agent': testValue,
},
}),
httpsRequest.get(`${protocol}://${hostname}:${serverPort}`, {
headers: {
'uSeR-aGeNt': testValue,
},
}),
})
]);
const spans = memoryExporter.getFinishedSpans();
assert.strictEqual(spans.length, 0);
Expand Down

0 comments on commit 3f203e3

Please sign in to comment.