private List<String> getHeaderValues(String headerName, String originalValue) { return getHeaderValues(headerName, originalValue, DEFAULT_SEPARATOR); }
private List<String> getHeaderValues(String headerName, String originalValue) { return getHeaderValues(headerName, originalValue, DEFAULT_SEPARATOR); }
private List<String> getListValues(String headerName) { List<String> values = headers.get(headerName); if (values == null || values.isEmpty() || values.get(0) == null) { return Collections.emptyList(); } if (HttpUtils.isDateRelatedHeader(headerName)) { return values; } List<String> actualValues = new LinkedList<>(); for (String v : values) { actualValues.addAll(getHeaderValues(headerName, v)); } return actualValues; }
private List<String> getListValues(String headerName) { List<String> values = headers.get(headerName); if (values == null || values.isEmpty() || values.get(0) == null) { return Collections.emptyList(); } if (HttpUtils.isDateRelatedHeader(headerName)) { return values; } List<String> actualValues = new LinkedList<String>(); for (String v : values) { actualValues.addAll(getHeaderValues(headerName, v)); } return actualValues; }
public Map<String, Cookie> getCookies() { List<String> values = headers.get(HttpHeaders.COOKIE); if (values == null || values.isEmpty()) { return Collections.emptyMap(); } Map<String, Cookie> cl = new HashMap<String, Cookie>(); for (String value : values) { if (value == null) { continue; } List<String> cs = value.contains("$") ? Collections.singletonList(value) : getHeaderValues(HttpHeaders.COOKIE, value, getCookieSeparator()); for (String c : cs) { Cookie cookie = Cookie.valueOf(c); cl.put(cookie.getName(), cookie); } } return cl; }
public List<String> getRequestHeader(String name) { boolean splitIndividualValue = MessageUtils.getContextualBoolean(message, HEADER_SPLIT_PROPERTY, false); List<String> values = headers.get(name); if (!splitIndividualValue || values == null || HttpUtils.isDateRelatedHeader(name)) { return values; } List<String> ls = new LinkedList<>(); for (String value : values) { if (value == null) { continue; } String sep = HttpHeaders.COOKIE.equalsIgnoreCase(name) ? getCookieSeparator(value) : DEFAULT_SEPARATOR; ls.addAll(getHeaderValues(name, value, sep)); } return ls; }
public Map<String, Cookie> getCookies() { List<String> values = headers.get(HttpHeaders.COOKIE); if (values == null || values.isEmpty()) { return Collections.emptyMap(); } Map<String, Cookie> cl = new HashMap<>(); for (String value : values) { if (value == null) { continue; } List<String> cs = getHeaderValues(HttpHeaders.COOKIE, value, getCookieSeparator(value)); for (String c : cs) { Cookie cookie = Cookie.valueOf(c); cl.put(cookie.getName(), cookie); } } return cl; }
public List<String> getRequestHeader(String name) { List<String> values = headers.get(name); if (values == null || values.isEmpty() || values.get(0) == null) { return Collections.emptyList(); } boolean splitIndividualValue = MessageUtils.isTrue(message.getContextualProperty(HEADER_SPLIT_PROPERTY)); if (!splitIndividualValue || HttpUtils.isDateRelatedHeader(name)) { return values; } List<String> ls = new LinkedList<String>(); for (String value : values) { if (value == null) { continue; } String sep = HttpHeaders.COOKIE.equalsIgnoreCase(name) ? getCookieSeparator() : DEFAULT_SEPARATOR; ls.addAll(getHeaderValues(name, value, sep)); } return ls; }