-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Remove Alt-Svc parser on browser-wasm. #52681
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
Conversation
Contributes to dotnet#44534
|
Tagging subscribers to this area: @dotnet/ncl Issue DetailsContributes to #44534 Spinning this off into a separate PR from the discussion on #52572 (comment). Before: 2,660,648 bytes
|
|
Tagging subscribers to 'size-reduction': @eerhardt, @SamMonoRT, @marek-safar, @CoffeeFlux Issue DetailsContributes to #44534 Spinning this off into a separate PR from the discussion on #52572 (comment). Before: 2,660,648 bytes
|
| public static readonly KnownHeader XXssProtection = new KnownHeader("X-XSS-Protection", HttpHeaderType.Custom, null, new string[] { "0", "1", "1; mode=block" }); | ||
|
|
||
| private static HttpHeaderParser? GetAltSvcHeaderParser() => | ||
| #if TARGET_BROWSER |
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.
You could also use SocketsHttpHandler.IsSupported check
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 approach has 2 disadvantages:
- We would need to suppress this:
C:\git\runtime\src\libraries\System.Net.Http\src\System\Net\Http\Headers\KnownHeaders.cs(112,13):
error CA1416: This call site is reachable on: 'Browser'. 'SocketsHttpHandler.IsSupported' is unsupported on: 'Browser'. [C:\git\runtime\src\libraries\System.Net.Http\src\System.Net.Http.csproj]
- This way, on
Browser, AltSvcHeaderParser isn't even compiled into the library. So if someone tries to take a reference to it in some other code, they will consciously need to add it back to be compiled during theBrowserbuild.
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.
We would need to suppress this:
You could use guarded supported attribute
AltSvcHeaderParser isn't even compiled into the library.
It's the same it would be removed by linker during build and if someone adds it back it should trigger size regression warning
Just showing an alternative way to implement this
Contributes to #44534
Spinning this off into a separate PR from the discussion on #52572 (comment).
Before: 2,660,648 bytes
After: 2,658,176 bytes