SEC-1412: Modify DefaultSavedRequest to ignore If-Not-Matched header.

The browser (or at least Firefox) does not send it after a redirect, and it causes problems with Spring's ShallowEtagHeaderFilter if it is stored and returned by the saved request.
This commit is contained in:
Luke Taylor
2010-02-18 00:02:57 +00:00
parent 9bdc012c69
commit 14ae36ac3b
2 changed files with 15 additions and 0 deletions

View File

@@ -21,6 +21,15 @@ public class DefaultSavedRequestTests {
assertEquals("Mozilla", saved.getHeaderValues("user-agent").get(0));
}
// SEC-1412
@Test
public void discardsIfNoneMatchHeader() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader("If-None-Match", "somehashvalue");
DefaultSavedRequest saved = new DefaultSavedRequest(request, new MockPortResolver(8080, 8443));
assertTrue(saved.getHeaderValues("if-none-match").isEmpty());
}
// TODO: Why are parameters case insensitive. I think this is a mistake
@Test
public void parametersAreCaseInsensitive() throws Exception {