[TYRUS-13] No error report reported if subprotocol not supported Created: 16/Oct/12  Updated: 08/Aug/13  Resolved: 07/Feb/13

Status: Resolved
Project: tyrus
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0

Type: Bug Priority: Major
Reporter: arungupta Assignee: Pavel Bucek
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

An endpoint is created as:

@WebSocketEndpoint(path="/endpoint", subprotocols="myProtocol")

and the client initiates the connection as

var websocket = new WebSocket(wsUri, "myProtocol2");

The WebSocket on the client is correctly not initialized. But no error is thrown on the server-side to indicate what went wrong.

The app is deployed on GlassFish build 57.



 Comments   
Comment by Pavel Bucek [ 07/Feb/13 ]

from websocket rfc:

   Additional header fields are used to select options in the WebSocket
   Protocol.  Typical options available in this version are the
   subprotocol selector (|Sec-WebSocket-Protocol|), list of extensions
   support by the client (|Sec-WebSocket-Extensions|), |Origin| header
   field, etc.  The |Sec-WebSocket-Protocol| request-header field can be
   used to indicate what subprotocols (application-level protocols
   layered over the WebSocket Protocol) are acceptable to the client.
   *****The server selects one or none***** of the acceptable protocols and echoes
   that value in its handshake to indicate that it has selected that
   protocol.

you can intercept response headers (see ClientEndpointConfiguration#afterResponse(HandshakeResponse hr)).

No error needs to be reported, closing as invalid.

Generated at Tue Apr 21 06:35:42 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.