-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix W3CTraceContextPropagator for non-standard array types (#6654)
## Summary of changes The `W3CTraceContextPropagator` would check whether there was a single `traceparent` header value to determine whether or not it should extract W3C headers further. For non-standard array types it would _always_ return `false` meaning that headers wouldn't be extracted. This pull request fixes that so that non-standard array types will return `true` to allow extraction to happen. ## Reason for change If we have valid headers we should extract them. ## Implementation details Swapped to `GetEnumerator` as it seems more readable than the `foreach` route. If we have one value return `true` instead of `false`. Swapped the `TryGetSingle` and `TryGetSingleRare` to `internal` to add direct unit tests to them. ## Test coverage - Added tests for `TryGetSingle` and `TryGetSingleRare` testing fundamental behavior. - Added tests for `Extract` to test possible behavior we could see. ## Other details <!-- Fixes #{issue} --> Fixes #6596 <!--⚠️ Note: where possible, please obtain 2 approvals prior to merging. Unless CODEOWNERS specifies otherwise, for external teams it is typically best to have one review from a team member, and one review from apm-dotnet. Trivial changes do not require 2 reviews. -->
- Loading branch information
Showing
2 changed files
with
161 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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