diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/LegacyPropagator.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/LegacyPropagator.cs index 04a478fde94c40..c2d04607e43ab2 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/LegacyPropagator.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/LegacyPropagator.cs @@ -167,8 +167,7 @@ internal static bool TryExtractBaggage(string baggageString, out IEnumerable>(); - // Insert in reverse order for asp.net compatibility. - baggageList.Insert(0, new KeyValuePair( + baggageList.Add(new KeyValuePair( WebUtility.UrlDecode(baggageString.Substring(keyStart, keyEnd - keyStart)).Trim(s_trimmingSpaceCharacters), WebUtility.UrlDecode(baggageString.Substring(valueStart, currentIndex - valueStart)).Trim(s_trimmingSpaceCharacters))); } @@ -182,6 +181,9 @@ internal static bool TryExtractBaggage(string baggageString, out IEnumerable>() { new KeyValuePair(" LegacyKey1 ", " LegacyValue1 ") }); + new List>() { + new KeyValuePair(" LegacyKey1 ", " LegacyValue1 "), + new KeyValuePair("LegacyKey1b", "LegacyValue1b"), + new KeyValuePair("LegacyKey1c", "LegacyValue1c") }); TestLegacyPropagatorUsingHierarchicalActivity( DistributedContextPropagator.Current, "Legacy2=true", - new List>() { new KeyValuePair("LegacyKey2", "LegacyValue2") }); + new List>() { + new KeyValuePair("LegacyKey2", "LegacyValue2"), + new KeyValuePair("LegacyKey2b", "LegacyValue2b"), + new KeyValuePair("LegacyKey2c", "LegacyValue2c") }); TestFields(DistributedContextPropagator.Current);