/** * Returns the value of the {@code Sec-WebSocket-Key} header. * @return the value of the header */ public List<String> getSecWebSocketProtocol() { List<String> values = get(SEC_WEBSOCKET_PROTOCOL); if (CollectionUtils.isEmpty(values)) { return Collections.emptyList(); } else if (values.size() == 1) { return getValuesAsList(SEC_WEBSOCKET_PROTOCOL); } else { return values; } }
/** * Returns the value of the {@code Sec-WebSocket-Extensions} header. * @return the value of the header */ public List<WebSocketExtension> getSecWebSocketExtensions() { List<String> values = get(SEC_WEBSOCKET_EXTENSIONS); if (CollectionUtils.isEmpty(values)) { return Collections.emptyList(); } else { List<WebSocketExtension> result = new ArrayList<>(values.size()); for (String value : values) { result.addAll(WebSocketExtension.parseExtensions(value)); } return result; } }
WebSocketHttpHeaders.class); assertEquals("FOO", headers.getOrigin()); assertEquals(Arrays.asList("BAR", "baz"), headers.get("FOO"));
/** * Returns the value of the {@code Sec-WebSocket-Key} header. * @return the value of the header */ public List<String> getSecWebSocketProtocol() { List<String> values = get(SEC_WEBSOCKET_PROTOCOL); if (CollectionUtils.isEmpty(values)) { return Collections.emptyList(); } else if (values.size() == 1) { return getValuesAsList(SEC_WEBSOCKET_PROTOCOL); } else { return values; } }
/** * Returns the value of the {@code Sec-WebSocket-Extensions} header. * @return the value of the header */ public List<WebSocketExtension> getSecWebSocketExtensions() { List<String> values = get(SEC_WEBSOCKET_EXTENSIONS); if (CollectionUtils.isEmpty(values)) { return Collections.emptyList(); } else { List<WebSocketExtension> result = new ArrayList<>(values.size()); for (String value : values) { result.addAll(WebSocketExtension.parseExtensions(value)); } return result; } }
/** * Returns the value of the {@code Sec-WebSocket-Key} header. * @return the value of the header */ public List<String> getSecWebSocketProtocol() { List<String> values = get(SEC_WEBSOCKET_PROTOCOL); if (CollectionUtils.isEmpty(values)) { return Collections.emptyList(); } else if (values.size() == 1) { return getValuesAsList(SEC_WEBSOCKET_PROTOCOL); } else { return values; } }
/** * Returns the value of the {@code Sec-WebSocket-Extensions} header. * @return the value of the header */ public List<WebSocketExtension> getSecWebSocketExtensions() { List<String> values = get(SEC_WEBSOCKET_EXTENSIONS); if (CollectionUtils.isEmpty(values)) { return Collections.emptyList(); } else { List<WebSocketExtension> result = new ArrayList<>(values.size()); for (String value : values) { result.addAll(WebSocketExtension.parseExtensions(value)); } return result; } }