resetContent does not reset Date Header Signed-off-by: gregw <gregw@webtide.com>
This commit is contained in:
parent
96d2977942
commit
cba1fd6930
|
@ -1253,7 +1253,6 @@ public class Response implements HttpServletResponse
|
||||||
case LAST_MODIFIED:
|
case LAST_MODIFIED:
|
||||||
case EXPIRES:
|
case EXPIRES:
|
||||||
case ETAG:
|
case ETAG:
|
||||||
case DATE:
|
|
||||||
case VARY:
|
case VARY:
|
||||||
i.remove();
|
i.remove();
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -154,6 +154,7 @@ public class ErrorHandlerTest
|
||||||
assertThat("Response status code", response.getStatus(), is(404));
|
assertThat("Response status code", response.getStatus(), is(404));
|
||||||
assertThat("Response Content-Length", response.getField(HttpHeader.CONTENT_LENGTH).getIntValue(), greaterThan(0));
|
assertThat("Response Content-Length", response.getField(HttpHeader.CONTENT_LENGTH).getIntValue(), greaterThan(0));
|
||||||
assertThat("Response Content-Type", response.get(HttpHeader.CONTENT_TYPE), containsString("text/html;charset=ISO-8859-1"));
|
assertThat("Response Content-Type", response.get(HttpHeader.CONTENT_TYPE), containsString("text/html;charset=ISO-8859-1"));
|
||||||
|
assertThat(response.get(HttpHeader.DATE), notNullValue());
|
||||||
assertThat(response.getContent(), containsString("content=\"text/html;charset=ISO-8859-1\""));
|
assertThat(response.getContent(), containsString("content=\"text/html;charset=ISO-8859-1\""));
|
||||||
|
|
||||||
assertContent(response);
|
assertContent(response);
|
||||||
|
|
|
@ -2090,6 +2090,7 @@ public class ResponseTest
|
||||||
response.setContentType("some/type");
|
response.setContentType("some/type");
|
||||||
response.setContentLength(3);
|
response.setContentLength(3);
|
||||||
response.setHeader(HttpHeader.EXPIRES, "never");
|
response.setHeader(HttpHeader.EXPIRES, "never");
|
||||||
|
response.setHeader(HttpHeader.DATE, "2000-01-01");
|
||||||
|
|
||||||
response.setHeader("SomeHeader", "SomeValue");
|
response.setHeader("SomeHeader", "SomeValue");
|
||||||
|
|
||||||
|
@ -2106,6 +2107,7 @@ public class ResponseTest
|
||||||
|
|
||||||
// check arbitrary header still set
|
// check arbitrary header still set
|
||||||
assertThat(response.getHeader("SomeHeader"), is("SomeValue"));
|
assertThat(response.getHeader("SomeHeader"), is("SomeValue"));
|
||||||
|
assertThat(response.getHeader("Date"), is("2000-01-01"));
|
||||||
|
|
||||||
// check cookies are still there
|
// check cookies are still there
|
||||||
Enumeration<String> set = response.getHttpFields().getValues("Set-Cookie");
|
Enumeration<String> set = response.getHttpFields().getValues("Set-Cookie");
|
||||||
|
|
Loading…
Reference in New Issue