Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(http): remove outgoing headers normalization #3557

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