You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Subsequently, when WebServletRequest.checkNotModified() is invoked, it calls validateIfUnmodifiedSince(). If the header is present and populated with a valid value, this will return true, which will then go to a branch which invariably returns from the method. Further down, the two headers are readded, but those are never reached.
In these cases, a sample application demonstrating the problem would help a lot.
Could you share a small project (typically a small web app created with start.spring.io m) that we can git clone or download? Ideally, with a readme that lists a curl request, the expected result and what you got instead.
Pointing to various places in the codebase helps, but it's too early for that and we need consider the use case as a whole first.
Thanks!
Affects: 5.3.23
When handling the response,
HttpEntityMethodProcessor
callsisResourceNotModified()
which removes theLast-Modified
andEtag
headers, set already in the response:https://github.com/spring-projects/spring-framework/blob/5.3.x/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessor.java#L247
Subsequently, when
WebServletRequest.checkNotModified()
is invoked, it callsvalidateIfUnmodifiedSince()
. If the header is present and populated with a valid value, this will return true, which will then go to a branch which invariably returns from the method. Further down, the two headers are readded, but those are never reached.https://github.com/spring-projects/spring-framework/blob/5.3.x/spring-web/src/main/java/org/springframework/web/context/request/ServletWebRequest.java#L219
Therefore, even if the
If-Unmodified-Since
condition passes, those headers are removed from the response.The text was updated successfully, but these errors were encountered: