Skip to content

Commit a832c98

Browse files
committed
Polish contribution
See gh-29460
1 parent c12d93c commit a832c98

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spring-web/src/main/java/org/springframework/web/context/request/ServletWebRequest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,11 @@ else if (validateIfUnmodifiedSince(lastModifiedTimestamp)) {
231231
}
232232

233233
private boolean validateIfMatch(@Nullable String eTag) {
234+
if (SAFE_METHODS.contains(getRequest().getMethod())) {
235+
return false;
236+
}
234237
Enumeration<String> ifMatchHeaders = getRequest().getHeaders(HttpHeaders.IF_MATCH);
235-
if (SAFE_METHODS.contains(getRequest().getMethod()) || !ifMatchHeaders.hasMoreElements()) {
238+
if (!ifMatchHeaders.hasMoreElements()) {
236239
return false;
237240
}
238241
this.notModified = matchRequestedETags(ifMatchHeaders, eTag, false);

0 commit comments

Comments
 (0)