From 6aa22993d0be6935f58ef734b3143f465c7a73e8 Mon Sep 17 00:00:00 2001 From: Sourabh Shirhatti Date: Mon, 19 Jul 2021 22:39:40 -0700 Subject: [PATCH] Add comment about order of baggage items Follow up from https://github.com/dotnet/aspnetcore/pull/33777 --- .../Hosting/src/Internal/HostingApplicationDiagnostics.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs b/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs index a5148fda6902..277375852606 100644 --- a/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs +++ b/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs @@ -307,6 +307,8 @@ private static void RecordRequestStartEventLog(HttpContext httpContext) fieldValue = headers[fieldName]; }); + // AddBaggage adds items at the beginning of the list, so we need to add them in reverse to keep the same order as the client + // By contract, the propagator has already reversed the order of items so we need not reverse it again // Order could be important if baggage has two items with the same key (that is allowed by the contract) if (baggage is not null) {