tyrus
  1. tyrus
  2. TYRUS-13

No error report reported if subprotocol not supported

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None

      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.

        Activity

        Hide
        Pavel Bucek added a comment -

        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.

        Show
        Pavel Bucek added a comment - 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.

          People

          • Assignee:
            Pavel Bucek
            Reporter:
            arungupta
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: