/** * Facade method to validate an HttpMessageRequest. * * @param request the request to validate * @return true iff the appropriate handshake for websocket protocol is contained * within the provided request. */ public boolean validate(HttpRequestMessage request, boolean isPostMethodAllowed) { WebSocketWireProtocol wireProtocolVersion = guessWireProtocolVersion(request); if ( wireProtocolVersion == null ) { return false; } final WsHandshakeValidator validator = handshakeValidatorsByWireProtocolVersion.get(wireProtocolVersion); return validator != null && validator.doValidate(request, isPostMethodAllowed); }
WebSocketWireProtocol protocol = WsHandshakeValidator.guessWireProtocolVersion(httpRequest); if ( protocol != null && initialHttpRequest == null &&