@Test public void testApply() { HttpServletResponse response = new MockHttpServletResponse(); headers.apply(response); assertTrue(response.containsHeader(headerName)); assertTrue(response.containsHeader(multivalueHeaderName)); assertFalse(response.containsHeader("Non-Existing-Header")); }
void apply(HttpServletResponse response) { if (response == null) return; for (Map.Entry<String, String> e : headers.entrySet()) { String key = e.getKey(); int hashIndex = key.indexOf('#'); if (hashIndex > 0) key = key.substring(hashIndex); if (!ignoredHeaders.contains(key.toLowerCase())) response.addHeader(key, e.getValue()); } }
CacheableHttpServletResponseHeaders implements Serializable { void apply(HttpServletResponse response) { if (response == null) return; for (Map.Entry<String, String> e : headers.entrySet()) { String key = e.getKey(); int hashIndex = key.indexOf('#'); if (hashIndex > 0) key = key.substring(hashIndex); if (!ignoredHeaders.contains(key.toLowerCase())) response.addHeader(key, e.getValue()); } } }
CacheableHttpServletResponseHeaders implements Serializable { void apply(HttpServletResponse response) { if (response == null) return; for (Map.Entry<String, String> e : headers.entrySet()) { String key = e.getKey(); int hashIndex = key.indexOf('#'); if (hashIndex > 0) key = key.substring(hashIndex); if (!ignoredHeaders.contains(key.toLowerCase())) response.addHeader(key, e.getValue()); } }  }
CacheableHttpServletResponseHeaders implements Serializable { void apply(HttpServletResponse response) { if (response == null) return; for (Map.Entry<String, String> e : headers.entrySet()) { String key = e.getKey(); int hashIndex = key.indexOf('#'); if (hashIndex > 0) key = key.substring(hashIndex); if (!ignoredHeaders.contains(key.toLowerCase())) response.addHeader(key, e.getValue()); } }  int size(); }
CacheableHttpServletResponseHeaders implements Serializable { void apply(HttpServletResponse response) { if (response == null) return; for (Map.Entry<String, String> e : headers.entrySet()) { String key = e.getKey(); int hashIndex = key.indexOf('#'); if (hashIndex > 0) key = key.substring(hashIndex); if (!ignoredHeaders.contains(key.toLowerCase())) response.addHeader(key, e.getValue()); } }  int size();  }