Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ internal static bool TryExtractBaggage(string baggageString, out IEnumerable<Key
{
baggageList ??= new List<KeyValuePair<string, string?>>();

// Insert in reverse order for asp.net compatibility.
baggageList.Insert(0, new KeyValuePair<string, string?>(
baggageList.Add(new KeyValuePair<string, string?>(
WebUtility.UrlDecode(baggageString.Substring(keyStart, keyEnd - keyStart)).Trim(s_trimmingSpaceCharacters),
WebUtility.UrlDecode(baggageString.Substring(valueStart, currentIndex - valueStart)).Trim(s_trimmingSpaceCharacters)));
}
Expand All @@ -182,6 +181,9 @@ internal static bool TryExtractBaggage(string baggageString, out IEnumerable<Key
currentIndex++; // Move to next key-value entry
} while (currentIndex < baggageString.Length);

// Reverse order for asp.net compatibility.
baggageList?.Reverse();

baggage = baggageList;
return baggageList != null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,18 @@ public void TestAllPropagators()
TestLegacyPropagatorUsingW3CActivity(
DistributedContextPropagator.Current,
"Legacy1=true",
new List<KeyValuePair<string, string>>() { new KeyValuePair<string, string>(" LegacyKey1 ", " LegacyValue1 ") });
new List<KeyValuePair<string, string>>() {
new KeyValuePair<string, string>(" LegacyKey1 ", " LegacyValue1 "),
new KeyValuePair<string, string>("LegacyKey1b", "LegacyValue1b"),
new KeyValuePair<string, string>("LegacyKey1c", "LegacyValue1c") });

TestLegacyPropagatorUsingHierarchicalActivity(
DistributedContextPropagator.Current,
"Legacy2=true",
new List<KeyValuePair<string, string>>() { new KeyValuePair<string, string>("LegacyKey2", "LegacyValue2") });
new List<KeyValuePair<string, string>>() {
new KeyValuePair<string, string>("LegacyKey2", "LegacyValue2"),
new KeyValuePair<string, string>("LegacyKey2b", "LegacyValue2b"),
new KeyValuePair<string, string>("LegacyKey2c", "LegacyValue2c") });

TestFields(DistributedContextPropagator.Current);

Expand Down
Loading