-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add an Analyzer to recommend against IHeaderDictionary.Add #41362
Copy link
Copy link
Closed
Labels
analyzerIndicates an issue which is related to analyzer experienceIndicates an issue which is related to analyzer experiencearea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionshelp wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issue
Milestone
Metadata
Metadata
Assignees
Labels
analyzerIndicates an issue which is related to analyzer experienceIndicates an issue which is related to analyzer experiencearea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionshelp wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issue
Type
Fields
Give feedbackNo fields configured for issues without a type.
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
IHeaderDictionary.Add throws if duplicate keys are added (Matches IDictionary). Most people want to set or append. They can set using the indexer (
IHeaderDictioanry[key] = value) or append by calling Append. This is especially confusing when moving from System.Web where Headers.Add appended.Describe the solution you'd like
We should add an analyzer that warns people not to use Add, but to use the indexer or Append instead.
Additional context
No response