Skip to content

Commit 607f067

Browse files
committed
Keep baggage, tracestate, and traceparent with previous casing
1 parent e90f998 commit 607f067

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/Http/Headers/src/HeaderNames.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static class HeaderNames
6565
public static readonly string Authorization = "Authorization";
6666

6767
/// <summary>Gets the <c>baggage</c> HTTP header name.</summary>
68-
public static readonly string Baggage = "Baggage";
68+
public static readonly string Baggage = "baggage";
6969

7070
/// <summary>Gets the <c>Cache-Control</c> HTTP header name.</summary>
7171
public static readonly string CacheControl = "Cache-Control";
@@ -248,10 +248,10 @@ public static class HeaderNames
248248
public static readonly string Translate = "Translate";
249249

250250
/// <summary>Gets the <c>traceparent</c> HTTP header name.</summary>
251-
public static readonly string TraceParent = "TraceParent";
251+
public static readonly string TraceParent = "traceparent";
252252

253253
/// <summary>Gets the <c>tracestate</c> HTTP header name.</summary>
254-
public static readonly string TraceState = "TraceState";
254+
public static readonly string TraceState = "tracestate";
255255

256256
/// <summary>Gets the <c>Upgrade</c> HTTP header name.</summary>
257257
public static readonly string Upgrade = "Upgrade";

src/Servers/Kestrel/shared/KnownHeaders.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,14 @@ public class KnownHeader
387387

388388
private string ResolveIdentifier(string name)
389389
{
390+
// Check the 3 lowercase headers
391+
switch (name)
392+
{
393+
case "baggage": return "Baggage";
394+
case "traceparent": return "TraceParent";
395+
case "tracestate": return "TraceState";
396+
}
397+
390398
var identifier = name.Replace("-", "");
391399

392400
// Pseudo headers start with a colon. A colon isn't valid in C# names so

0 commit comments

Comments
 (0)