Fix server errors for invalid If-None-Match request headers
HttpEntityMethodProcessor should not throw IllegalArgumentExceptions for invalid If-None-Match headers. For those cases, this commit makes sure that both `HttpEntityMethodProcessor` and `ServletWebRequest` have a consistent behavior and stop processing the request as conditional and leave the handler handle it. Issue: SPR-14559
This commit is contained in:
@@ -99,6 +99,15 @@ public class ServletWebRequestHttpMethodsTests {
|
||||
assertEquals(dateFormat.format(epochTime), servletResponse.getHeader("Last-Modified"));
|
||||
}
|
||||
|
||||
@Test // SPR-14559
|
||||
public void checkNotModifiedInvalidIfNoneMatchHeader() {
|
||||
String eTag = "\"etagvalue\"";
|
||||
servletRequest.addHeader("If-None-Match", "missingquotes");
|
||||
assertFalse(request.checkNotModified(eTag));
|
||||
assertEquals(200, servletResponse.getStatus());
|
||||
assertEquals(eTag, servletResponse.getHeader("ETag"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void checkNotModifiedHeaderAlreadySet() {
|
||||
long epochTime = currentDate.getTime();
|
||||
|
||||
Reference in New Issue
Block a user