code: private boolean isWebsocketRequest(HttpServletRequest request) {
  		String upgradeHeader = request.getHeader("Upgrade");
  		return upgradeHeader != null && upgradeHeader.toLowerCase().contains("websocket");
  	}
docs: According to the Websocket spec (https://tools.ietf.org/html/rfc6455): The WebSocket Protocol
  5. The request MUST contain an |Upgrade| header field whose value MUST include the "websocket" keyword.