Fix IIS outofprocess to remove WebSocket compression handshake#58846
Merged
BrennanConroy merged 2 commits intomainfrom Nov 13, 2024
Merged
Fix IIS outofprocess to remove WebSocket compression handshake#58846BrennanConroy merged 2 commits intomainfrom
BrennanConroy merged 2 commits intomainfrom
Conversation
|
|
||
| // WinHttp does not support any extensions being returned by the server, so we remove the request header to avoid the server | ||
| // responding with any accepted extensions. | ||
| pRequest->DeleteHeader("Sec-WebSocket-Extensions"); |
Member
There was a problem hiding this comment.
I'm assuming this is fine even if the header doesn't exist?
Member
Author
There was a problem hiding this comment.
The doc comments don't discuss it, but looking at the code it seems to check for existence internally. Also, the non-compression websocket tests should cover that scenario.
javiercn
approved these changes
Nov 13, 2024
Member
Author
|
/backport to release/9.0 |
Contributor
|
Started backporting to release/9.0: https://github.com/dotnet/aspnetcore/actions/runs/11826616953 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://github.com/dotnet/AspNetCore-ManualTests/issues/2688
Blazor enabled websocket compression by default and it turns out our forwarder in IIS OutOfProcess doesn't support websocket compression. Both the WinHttp and websocket.dll layers (which we use) do not support the compression framing.
The WinHttp layer hard codes sending 0
Sec-WebSocket-Extensionssettings to websocket.dll but since we are just forwarding the client request which might contain a Sec-WebSocket-Extensions header, the server might then return aSec-WebSocket-Extensionsheader in the response which will be rejected by websocket.dll due to it expecting 0 extensions from the earlier WinHttp call.So the fix is to just remove the
Sec-WebSocket-Extensionsheader from the request (which is effectively what WinHttp did without actually modifying the headers) so the server won't potentially respond with anySec-WebSocket-Extensionsheader in the response.Also, did a bunch of test work to move the websocket tests out of just IISExpress and to enable OutOfProcess testing as well.