tyrus
  1. tyrus
  2. TYRUS-205

ServerEndpointConfig.Configurator#getNegotiatedSubprotocol does not return subprotocol in the order they were requested by the client

    Details

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

      Description

      javadoc of ServerEndpointConfig.Configurator#getNegotiatedSubprotocol says:

      The default platform implementation of this method returns the first subprotocol in the list sent by the client that the server supports,

      suppose the following configurator:

      public class GetNegotiatedSubprotocolConfigurator extends Configurator {
      	public static List<String> supported;
      	public static List<String> requested;
      	public static String resulted;
      
      	@Override
      	public String getNegotiatedSubprotocol(List<String> supported,
      			List<String> requested) {
      		GetNegotiatedSubprotocolConfigurator.requested = requested;
      		GetNegotiatedSubprotocolConfigurator.supported = supported;
      		GetNegotiatedSubprotocolConfigurator.resulted = super
      				.getNegotiatedSubprotocol(supported, requested);
      		return resulted;
      	}
      }
      

      we have:
      supported=[MBLWS.huawei.com, wamp, v11.stomp, v10.stomp, soap]
      requested=[MBWS.huawei.com, soap, v10.stomp]
      resulted=10.stomp
      As per javadoc, "soap" should be the result as it is first in the list provided by client

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Pavel Bucek
            Reporter:
            jan.supol
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: