-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Reduce the size of HeaderDescriptor #64105
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 the size of HeaderDescriptor #64105
Conversation
|
Tagging subscribers to this area: @dotnet/ncl Issue DetailsFixes #62847 NonValidatedAdd_NonValidatedEnumerate:
SendAsync (Create and serialize the request, parse the response and enumerate 4 response headers)
|
| (new HeaderDescriptor(KnownHeaders.Authorization), ""), // 84 | ||
| (new HeaderDescriptor(KnownHeaders.ContentSecurityPolicy), "script-src 'none'; object-src 'none'; base-uri 'none'"), // 85 | ||
| (new HeaderDescriptor("early-data"), "1"), // 86 | ||
| (new HeaderDescriptor("expect-ct"), ""), // 87 |
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.
This is an existing bug in HTTP/3 where x-xss-protection and expect-ct lookups/removes would silently fail if added via OnStaticIndexedHeader.
src/libraries/System.Net.Http/src/System/Net/Http/Headers/HeaderDescriptor.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/Headers/HeaderDescriptor.cs
Outdated
Show resolved
Hide resolved
| public HttpHeaderParser? Parser => (_descriptor as KnownHeader)?.Parser; | ||
| public HttpHeaderType HeaderType => _descriptor is KnownHeader knownHeader ? knownHeader.HeaderType : HttpHeaderType.Custom; | ||
|
|
||
| public bool Equals(KnownHeader other) => ReferenceEquals(_descriptor, other); |
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.
It's a little weird to call this method "Equals".
I'd suggest calling it "IsKnownHeader(KnownHeader header)" but we already have a method called that.
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.
Would you find the == operator more fitting here?
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs
Show resolved
Hide resolved
|
@dotnet/ncl Please take a look |
ManickaP
left a comment
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 thanks
| (new HeaderDescriptor(KnownHeaders.ContentSecurityPolicy), "script-src 'none'; object-src 'none'; base-uri 'none'"), // 85 | ||
| (new HeaderDescriptor("early-data"), "1"), // 86 | ||
| (new HeaderDescriptor("expect-ct"), ""), // 87 | ||
| (new HeaderDescriptor(KnownHeaders.ExpectCT), ""), // 87 |
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.
Should we be adding KnownHeaders entries for the other new HeaderDescriptor(string) entries in this table?
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.
That would be my hope as part of #63750, I updated the post to include QPackStaticTable
Fixes #62847
NonValidatedAdd_NonValidatedEnumerate:
SendAsync (Create and serialize the request, parse the response and enumerate 4 response headers):