File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
spring-web/src/main/java/org/springframework/web/context/request Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -202,18 +202,23 @@ public boolean checkNotModified(String etag) {
202
202
203
203
@ Override
204
204
public boolean checkNotModified (@ Nullable String etag , long lastModifiedTimestamp ) {
205
+ if (this .notModified ) {
206
+ return true ;
207
+ }
208
+
205
209
HttpServletResponse response = getResponse ();
206
- if (this . notModified || ( response != null && HttpStatus .OK .value () != response .getStatus () )) {
207
- return this . notModified ;
210
+ if (response != null && HttpStatus .OK .value () != response .getStatus ()) {
211
+ return false ;
208
212
}
213
+
209
214
// Evaluate conditions in order of precedence.
210
215
// See https://datatracker.ietf.org/doc/html/rfc9110#section-13.2.2
211
216
if (validateIfMatch (etag )) {
212
217
updateResponseStateChanging (etag , lastModifiedTimestamp );
213
218
return this .notModified ;
214
219
}
215
220
// 2) If-Unmodified-Since
216
- else if (validateIfUnmodifiedSince (lastModifiedTimestamp )) {
221
+ if (validateIfUnmodifiedSince (lastModifiedTimestamp )) {
217
222
updateResponseStateChanging (etag , lastModifiedTimestamp );
218
223
return this .notModified ;
219
224
}
You can’t perform that action at this time.
0 commit comments