Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
ServletWebRequest can't validate Etag and Last-Modified together. [SPR-11324] #15948
HTTP 1.1. recommends to send both ETag and Last-Modified header:
Spring's ServletWebRequest seems to be designed for an isolated use of one of them, but not both. If an application wants to implement validation for both the first checkNotModified() call has more significance. This is in particular relevant if the first sets the state to notModified. The next call has no more effect:
Here is a further test case for ServletWebRequestTests which demonstrates the issue:
Affects: 4.0 GA
This issue is a sub-task of #16413
0 votes, 7 watchers
Markus Malkusch commented
Reading further in HTTP I see more issues regarding checkNotModified():
I don't want to bother you with more issues about this topic. But I would happily offer resources and provide a pull request.
Juergen Hoeller commented
Indeed, the not-modified check probably needs some general overhaul on Spring's side. Let's use this issue for all such ETag enhancements, and target them for 4.1 RC1 (June).
A pull request would be very welcome, of course!