fix(opentelemetry-instrumentation-fetch): fixed override of headers#2426
Merged
dyladan merged 5 commits intoopen-telemetry:mainfrom Aug 27, 2021
Merged
Conversation
Signed-off-by: Philip Szalla <philip@szalla.de>
|
|
dyladan
approved these changes
Aug 24, 2021
| set: (h, k, v) => h.set(k, typeof v === 'string' ? v : String(v)), | ||
| }); | ||
| } else if(options.headers instanceof Headers) { | ||
| // ||-operator causes ts type error |
Member
There was a problem hiding this comment.
What is this comment referring to?
Contributor
Author
There was a problem hiding this comment.
I tried to use the ||-operator inside the if-statement to avoid the else if and the code duplication. But it caused a type error at the setter-parameter of the api.propagation.inject-function.
Member
There was a problem hiding this comment.
The comment is pretty unclear on its own. I would just remove it since it's a typing issue and not a functionality caveat.
Codecov Report
@@ Coverage Diff @@
## main #2426 +/- ##
==========================================
+ Coverage 92.22% 92.70% +0.48%
==========================================
Files 120 137 +17
Lines 4013 4993 +980
Branches 850 1056 +206
==========================================
+ Hits 3701 4629 +928
- Misses 312 364 +52
|
Member
|
can you please add some unit tests to cover the fixes ? |
obecny
approved these changes
Aug 26, 2021
Member
|
@philipszalla can you please add a test to cover this? |
Signed-off-by: Philip Szalla <philip@szalla.de>
…ders Signed-off-by: Philip Szalla <philip@szalla.de>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Philip Szalla philip@szalla.de
Which problem is this PR solving?
opentelemetry-instrumentation-fetch removes headers from original request, when the
init-object is not an instance ofRequestbut theheaders-property is an instance ofHeaders.Fetch-requests made by https://github.com/pnp/pnpjs can cause this problem.
Short description of the changes
headers-property