Polish ServletWebRequest
Closes gh-33698
This commit is contained in:
committed by
Sébastien Deleuze
parent
b3cc9a219e
commit
ae32227b50
@@ -202,10 +202,15 @@ public class ServletWebRequest extends ServletRequestAttributes implements Nativ
|
||||
|
||||
@Override
|
||||
public boolean checkNotModified(@Nullable String etag, long lastModifiedTimestamp) {
|
||||
HttpServletResponse response = getResponse();
|
||||
if (this.notModified || (response != null && HttpStatus.OK.value() != response.getStatus())) {
|
||||
return this.notModified;
|
||||
if (this.notModified) {
|
||||
return true;
|
||||
}
|
||||
|
||||
HttpServletResponse response = getResponse();
|
||||
if (response != null && HttpStatus.OK.value() != response.getStatus()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Evaluate conditions in order of precedence.
|
||||
// See https://datatracker.ietf.org/doc/html/rfc9110#section-13.2.2
|
||||
if (validateIfMatch(etag)) {
|
||||
@@ -213,7 +218,7 @@ public class ServletWebRequest extends ServletRequestAttributes implements Nativ
|
||||
return this.notModified;
|
||||
}
|
||||
// 2) If-Unmodified-Since
|
||||
else if (validateIfUnmodifiedSince(lastModifiedTimestamp)) {
|
||||
if (validateIfUnmodifiedSince(lastModifiedTimestamp)) {
|
||||
updateResponseStateChanging(etag, lastModifiedTimestamp);
|
||||
return this.notModified;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user