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
Reduce size of HttpHeaderValueCollection #63057
Reduce size of HttpHeaderValueCollection #63057
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsRemove the _validator field by replacing with a check for GenericHeaderParser.TokenListParser, since this is the only thing validators were used for. Remove the _specialValue field by pushing handling of special values to callers.
|
@@ -22,8 +22,7 @@ public ICollection<string> Allow | |||
{ | |||
if (_allow == null) | |||
{ | |||
_allow = new HttpHeaderValueCollection<string>(KnownHeaders.Allow.Descriptor, | |||
this, HeaderUtilities.TokenValidator); | |||
_allow = new HttpHeaderValueCollection<string>(KnownHeaders.Allow.Descriptor, this); | |||
} | |||
return _allow; | |||
} |
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.
For future cleanup, this can be simplified to just:
public ICollection<string> Allow => _allow ??= new HttpHeaderValueCollection<string>(KnownHeaders.Allow.Descriptor, this);
Same for some other props below.
Remove the _validator field by replacing with a check for GenericHeaderParser.TokenListParser, since this is the only thing validators were used for.
Remove the _specialValue field by pushing handling of special values to callers.
Fixes #63054
Fixes #63050