Skip to content

Commit

Permalink
fix(http): remove outgoing headers normalization (#3557)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
  • Loading branch information
3 people authored Jan 30, 2023
1 parent d1f9594 commit 4978743
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All notable changes to experimental packages in this project will be documented
* Fixes an error where the generated JS files were not included in the esnext package due to a failure of the tsconfig generation
* fix(sdk-node): register instrumentations early [#3502](https://github.com/open-telemetry/opentelemetry-js/pull/3502) @flarna
* fix: include tracestate in export [#3569](https://github.com/open-telemetry/opentelemetry-js/pull/3569) @flarna
* fix(http) Remove outgoing headers normalization [#3557](https://github.com/open-telemetry/opentelemetry-js/pull/3557) @marcinjahn

### :books: (Refine Doc)

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 @@ -460,11 +460,6 @@ describe('HttpsInstrumentation', () => {
'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 4978743

Please sign in to comment.