-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[release/6.0] Allow retaining the original casing for known header values #80754
[release/6.0] Allow retaining the original casing for known header values #80754
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsBackport of #64702 to release/6.0, gated behind an AppContext switch. Set to draft pending customer validation. Customer ImpactTODO TestingTODO RiskTODO
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Approved by @SteveMCarroll on 1/23 via email - "[Servicing-Consider] [6.0.X] Allow retaining the original casing for known header values". |
Approved by Tactics for 6.0.15. |
Backport of #64702 to release/6.0, gated behind an AppContext switch.
Customer Impact
Starting with .NET Core 2.1 and later expanded in .NET 5.0, we introduced a performance optimization where we avoid allocating strings for common well-known header values.
We did this in a case-insensitive manner, so if the server sent us
Connection: close
orConnection: CLOSE
, they would both be exposed to the user asclose
.As services are migrating from Framework to Core, this represents a change in behavior that can't be avoided as the optimization is taking place lower in the stack before the information is exposed to the user.
Clients running different versions of .NET may therefore not agree on the exact response provided by the server, which can break scenarios such as signature validation.
We stopped doing case-insensitive matching in .NET 7.0, and this PR brings the option to do the same on the 6.0 LTS release to unblock migration.
Testing
I added a targeted test to verify the expected behavior is observed if the
AppContext
switch is set.The customer validated the new behavior using a private build of
System.Net.Http
.Risk
Practically zero. The change in behavior is hidden behind an
AppContext
switch.