@Test public void testFailToValidateOnBadVersionNumber() throws Exception { HttpRequestMessage request = makeHandshakeRequest(); request.addHeader(SEC_WEB_SOCKET_VERSION, "Bad"); request.addHeader(SEC_WEB_SOCKET_KEY, new String(Base64.encodeBase64(new byte[16]), "UTF-8")); assertFalse(validator.validate(request)); request = makeHandshakeRequest(); request.addHeader(SEC_WEB_SOCKET_VERSION, "500"); request.addHeader(SEC_WEB_SOCKET_KEY, new String(Base64.encodeBase64(new byte[16]), "UTF-8")); assertFalse(validator.validate(request)); }
public boolean validate(HttpRequestMessage request) { return validate(request, true); }
WsHandshakeValidator { public boolean validate(HttpRequestMessage request) { return validate(request, true); } }
WsHandshakeValidator { public boolean validate(HttpRequestMessage request) { return validate(request, true); }  }
WsHandshakeValidator { public boolean validate(HttpRequestMessage request) { return validate(request, true); }  boolean validate(HttpRequestMessage request); boolean validate(HttpRequestMessage request, boolean isPostMethodAllowed); static WebSocketWireProtocol guessWireProtocolVersion(HttpRequestMessage httpRequest); boolean requireHeader(HttpRequestMessage request, String name); boolean requireHeader(HttpRequestMessage request, String name, String value); boolean isInitialized(); synchronized void init(); }
WsHandshakeValidator { public boolean validate(HttpRequestMessage request) { return validate(request, true); }  boolean validate(HttpRequestMessage request); boolean validate(HttpRequestMessage request, boolean isPostMethodAllowed); static WebSocketWireProtocol guessWireProtocolVersion(HttpRequestMessage httpRequest); boolean requireHeader(HttpRequestMessage request, String name); boolean requireHeader(HttpRequestMessage request, String name, String value); boolean isInitialized(); synchronized void init(); static final String SEC_WEB_SOCKET_KEY; static final String SEC_WEB_SOCKET_VERSION; static final String SEC_WEB_SOCKET_KEY1; static final String SEC_WEB_SOCKET_KEY2; static Map<WebSocketWireProtocol, WsHandshakeValidator> handshakeValidatorsByWireProtocolVersion; }