Fix IIS outofprocess to remove WebSocket compression handshake #58846
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-Extensions
settings 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-Extensions
header 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-Extensions
header from the request (which is effectively what WinHttp did without actually modifying the headers) so the server won't potentially respond with anySec-WebSocket-Extensions
header 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.