}
@Override
public HandshakeChecker handshakeChecker(final URI uri, final Map<String, String> requestHeaders) {
final String sentKey = requestHeaders.get(Headers.SEC_WEB_SOCKET_KEY_STRING);
return new HandshakeChecker() {
@Override
public void checkHandshake(Map<String, String> headers) throws IOException {
String upgrade = headers.get(Headers.UPGRADE_STRING.toLowerCase(Locale.ENGLISH));
if (upgrade == null || !upgrade.trim().equalsIgnoreCase("websocket")) {
throw WebSocketMessages.MESSAGES.noWebSocketUpgradeHeader();