You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Faster because they directly fetch the known header value from the underlying collection.
Proposed API
An analyzer that looks for indexer use with a name that matches a property on IHeaderDictionary. This will only apply to header names that have a property, e.g.
varaccepts=context.Request.Headers["accepts"];// <- valid to fixvarid=context.Request.Headers["contoso-id"];// <- ignored
Usage Examples
Alternative Designs
Risks
The text was updated successfully, but these errors were encountered:
JamesNK
added
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
api-ready-for-review
API is ready for formal API review - https://github.com/dotnet/apireviews
labels
Oct 3, 2022
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
The PR contains changes to the reference-assembly that describe the API change. Or, you have included a snippet of reference-assembly-style code that illustrates the API change.
The PR describes the impact to users, both positive (useful new APIs) and negative (breaking changes).
Someone is assigned to "champion" this change in the meeting, and they understand the impact and design of the change.
Should it be Performance? Usage? Style? Usage wins the vote. The perf impact isn't big, but it also doesn't really avoid bugs because it only flags string literals that are known correct header names.
Category: Usage
Severity: Info
halter73
added
api-approved
API was approved in API review, it can be implemented
and removed
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
api-ready-for-review
API is ready for formal API review - https://github.com/dotnet/apireviews
labels
Oct 5, 2022
Background and Motivation
IHeaderDictionary
has DIM properties for many commonly used headers: https://github.com/dotnet/aspnetcore/blob/ff2148be7592be83f1f88e2f372ef04f02fdfdb8/src/Http/Http.Features/src/IHeaderDictionary.Keyed.csThese properties are better because:
Proposed API
An analyzer that looks for indexer use with a name that matches a property on
IHeaderDictionary
. This will only apply to header names that have a property, e.g.Usage Examples
Alternative Designs
Risks
The text was updated successfully, but these errors were encountered: