Skip to content

[browser][websockets][tests] Test failures for subprotocol by URI Query #45583

@kjpou1

Description

@kjpou1

Subprotocol support specified by URI query:

                var ub = new UriBuilder(server);
                ub.Query = "subprotocol=" + AcceptedProtocol;

throw the following exception:

  fail: [out of order message from the browser]: http://127.0.0.1:58688/dotnet.js 9661 WebSocket connection to 'ws://corefx-net-http11.azurewebsites.net/WebSocket/EchoWebSocket.ashx?subprotocol=CustomProtocol' failed: Error during WebSocket handshake: Unexpected response code: 400
  fail: [FAIL] System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAsync_PassNoSubProtocol_ServerRequires_ThrowsWebSocketException(server: ws://corefx-net-http11.azurewebsites.net/WebSocket/EchoWebSocket.ashx)
  info: Assert.True() Failure
  info: Expected: True
  info: Actual:   False
  info:    at System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAsync_PassNoSubProtocol_ServerRequires_ThrowsWebSocketException(Uri server)

subprotocols are supported via websockets options and specifying the subprotocol via the AddSubProtocol method.

cws.Options.AddSubProtocol(AcceptedProtocol);

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions