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) {
202202
203203 @ Override
204204 public boolean checkNotModified (@ Nullable String etag , long lastModifiedTimestamp ) {
205+ if (this .notModified ) {
206+ return true ;
207+ }
208+
205209 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 ;
208212 }
213+
209214 // Evaluate conditions in order of precedence.
210215 // See https://datatracker.ietf.org/doc/html/rfc9110#section-13.2.2
211216 if (validateIfMatch (etag )) {
212217 updateResponseStateChanging (etag , lastModifiedTimestamp );
213218 return this .notModified ;
214219 }
215220 // 2) If-Unmodified-Since
216- else if (validateIfUnmodifiedSince (lastModifiedTimestamp )) {
221+ if (validateIfUnmodifiedSince (lastModifiedTimestamp )) {
217222 updateResponseStateChanging (etag , lastModifiedTimestamp );
218223 return this .notModified ;
219224 }
You can’t perform that action at this time.
0 commit comments