private String getHeaderFieldDoNotForceResponse(String key) { for (int i = headers.size() - 1; i >= 0; i--) { HeaderEntry entry = headers.get(i); if (key == null) { if (entry.getKey() == null) { return entry.getValue(); } continue; } if (key.equals(entry.getKey())) { return entry.getValue(); } } return null; }
private Map<String, List<String>> getHeaderFieldsDoNotForceResponse() { Map<String, List<String>> map = new HashMap<String, List<String>>(); for (HeaderEntry entry : headers) { String k = entry.getKey(); String v = entry.getValue(); List<String> values = map.get(k); if (values == null) { values = new ArrayList<String>(); map.put(k, values); } values.add(v); } return map; }