Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
IHeaderDictionary has DIM properties for many commonly used headers: https://github.com/dotnet/aspnetcore/blob/ff2148be7592be83f1f88e2f372ef04f02fdfdb8/src/Http/Http.Features/src/IHeaderDictionary.Keyed.cs
Describe the solution you'd like
An analyzer that looks for indexer use with a name that matches a property.
e.g.
if (request.Headers["Content-Type"] == "application/json")
{
// ....
}
After change (could be done via a fixer):
if (request.Headers.ContentType == "application/json")
{
// ....
}
Additional context
No response
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
IHeaderDictionary has DIM properties for many commonly used headers: https://github.com/dotnet/aspnetcore/blob/ff2148be7592be83f1f88e2f372ef04f02fdfdb8/src/Http/Http.Features/src/IHeaderDictionary.Keyed.cs
Describe the solution you'd like
An analyzer that looks for indexer use with a name that matches a property.
e.g.
After change (could be done via a fixer):
Additional context
No response