@Test public void testIsWebsocketUpgrade() { HttpHeaders headers = new DefaultHttpHeaders(); assertFalse(WebSocketExtensionUtil.isWebsocketUpgrade(headers)); headers.add(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET); assertFalse(WebSocketExtensionUtil.isWebsocketUpgrade(headers)); headers.add(HttpHeaderNames.CONNECTION, "Keep-Alive, Upgrade"); assertTrue(WebSocketExtensionUtil.isWebsocketUpgrade(headers)); }
static boolean isWebsocketUpgrade(HttpHeaders headers) { return headers.containsValue(HttpHeaderNames.CONNECTION, HttpHeaderValues.UPGRADE, true) && headers.contains(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET, true); }
WebSocketExtensionUtil { static boolean isWebsocketUpgrade(HttpHeaders headers) { return headers.containsValue(HttpHeaderNames.CONNECTION, HttpHeaderValues.UPGRADE, true) && headers.contains(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET, true); } }
WebSocketExtensionUtil { static boolean isWebsocketUpgrade(HttpHeaders headers) { return headers.containsValue(HttpHeaderNames.CONNECTION, HttpHeaderValues.UPGRADE, true) && headers.contains(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET, true); } private  WebSocketExtensionUtil(); }
WebSocketExtensionUtil { static boolean isWebsocketUpgrade(HttpHeaders headers) { return headers.containsValue(HttpHeaderNames.CONNECTION, HttpHeaderValues.UPGRADE, true) && headers.contains(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET, true); } private  WebSocketExtensionUtil(); static List<WebSocketExtensionData> extractExtensions(String extensionHeader); }
WebSocketExtensionUtil { static boolean isWebsocketUpgrade(HttpHeaders headers) { return headers.containsValue(HttpHeaderNames.CONNECTION, HttpHeaderValues.UPGRADE, true) && headers.contains(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET, true); } private  WebSocketExtensionUtil(); static List<WebSocketExtensionData> extractExtensions(String extensionHeader);  }