Skip to content

Commit 4978743

Browse files
marcinjahndyladanFlarna
authored
fix(http): remove outgoing headers normalization (#3557)
Co-authored-by: Daniel Dyla <[email protected]> Co-authored-by: Gerhard Stöbich <[email protected]>
1 parent d1f9594 commit 4978743

File tree

4 files changed

+1
-18
lines changed

4 files changed

+1
-18
lines changed

experimental/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ All notable changes to experimental packages in this project will be documented
1414
* Fixes an error where the generated JS files were not included in the esnext package due to a failure of the tsconfig generation
1515
* fix(sdk-node): register instrumentations early [#3502](https://github.com/open-telemetry/opentelemetry-js/pull/3502) @flarna
1616
* fix: include tracestate in export [#3569](https://github.com/open-telemetry/opentelemetry-js/pull/3569) @flarna
17+
* fix(http) Remove outgoing headers normalization [#3557](https://github.com/open-telemetry/opentelemetry-js/pull/3557) @marcinjahn
1718

1819
### :books: (Refine Doc)
1920

experimental/packages/opentelemetry-instrumentation-http/src/utils.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -276,14 +276,6 @@ export const getRequestInfo = (
276276
origin = `${optionsParsed.protocol || 'http:'}//${hostname}`;
277277
}
278278

279-
const headers = optionsParsed.headers ?? {};
280-
optionsParsed.headers = Object.keys(headers).reduce(
281-
(normalizedHeader, key) => {
282-
normalizedHeader[key.toLowerCase()] = headers[key];
283-
return normalizedHeader;
284-
},
285-
{} as OutgoingHttpHeaders
286-
);
287279
// some packages return method in lowercase..
288280
// ensure upperCase for consistency
289281
const method = optionsParsed.method

experimental/packages/opentelemetry-instrumentation-http/test/functionals/http-enable.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,11 +508,6 @@ describe('HttpInstrumentation', () => {
508508
'user-agent': testValue,
509509
},
510510
}),
511-
httpRequest.get(`${protocol}://${hostname}:${serverPort}`, {
512-
headers: {
513-
'uSeR-aGeNt': testValue,
514-
},
515-
}),
516511
]);
517512
const spans = memoryExporter.getFinishedSpans();
518513
assert.strictEqual(spans.length, 0);

experimental/packages/opentelemetry-instrumentation-http/test/functionals/https-enable.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -460,11 +460,6 @@ describe('HttpsInstrumentation', () => {
460460
'user-agent': testValue,
461461
},
462462
}),
463-
httpsRequest.get(`${protocol}://${hostname}:${serverPort}`, {
464-
headers: {
465-
'uSeR-aGeNt': testValue,
466-
},
467-
}),
468463
]);
469464
const spans = memoryExporter.getFinishedSpans();
470465
assert.strictEqual(spans.length, 0);

0 commit comments

Comments
 (0)