Polish contribution

See gh-29460
This commit is contained in:
Sam Brannen 2022-11-22 14:23:49 +01:00
parent c12d93c5d1
commit a832c98ced
1 changed files with 4 additions and 1 deletions

View File

@ -231,8 +231,11 @@ public class ServletWebRequest extends ServletRequestAttributes implements Nativ
}
private boolean validateIfMatch(@Nullable String eTag) {
if (SAFE_METHODS.contains(getRequest().getMethod())) {
return false;
}
Enumeration<String> ifMatchHeaders = getRequest().getHeaders(HttpHeaders.IF_MATCH);
if (SAFE_METHODS.contains(getRequest().getMethod()) || !ifMatchHeaders.hasMoreElements()) {
if (!ifMatchHeaders.hasMoreElements()) {
return false;
}
this.notModified = matchRequestedETags(ifMatchHeaders, eTag, false);