Cache headers only if no cache headers set

Fixes: gh-5004
This commit is contained in:
Rob Winch
2018-02-07 14:40:36 -06:00
parent 2165cc72ef
commit ea3dd336aa
4 changed files with 111 additions and 29 deletions

View File

@@ -71,8 +71,8 @@ public class HttpSecurityHeadersTests {
mockMvc.perform(get("/resources/file.js"))
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.CACHE_CONTROL, "max-age=12345"))
.andExpect(header().string(HttpHeaders.PRAGMA, ""))
.andExpect(header().string(HttpHeaders.EXPIRES, ""));
.andExpect(header().doesNotExist(HttpHeaders.PRAGMA))
.andExpect(header().doesNotExist(HttpHeaders.EXPIRES));
}
@Test