Polish contribution

See gh-34223
This commit is contained in:
Stéphane Nicoll
2025-01-14 17:30:18 +01:00
parent 4acd9ee69b
commit 24fa9ea394
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -241,9 +241,9 @@ public class HttpEntityMethodProcessor extends AbstractMessageConverterMethodPro
}
if (httpEntity instanceof ResponseEntity<?> responseEntity) {
HttpStatusCode httpStatusCode = responseEntity.getStatusCode();
outputMessage.getServletResponse().setStatus(httpStatusCode.value());
if (HttpStatus.OK.value() == httpStatusCode.value()) {
HttpStatusCode returnStatus = responseEntity.getStatusCode();
outputMessage.getServletResponse().setStatus(returnStatus.value());
if (returnStatus.value() == HttpStatus.OK.value()) {
HttpMethod method = inputMessage.getMethod();
if ((HttpMethod.GET.equals(method) || HttpMethod.HEAD.equals(method))
&& isResourceNotModified(inputMessage, outputMessage)) {
@@ -251,7 +251,7 @@ public class HttpEntityMethodProcessor extends AbstractMessageConverterMethodPro
return;
}
}
else if (httpStatusCode.is3xxRedirection()) {
else if (returnStatus.is3xxRedirection()) {
String location = outputHeaders.getFirst(HttpHeaders.LOCATION);
if (location != null) {
saveFlashAttributes(mavContainer, webRequest, location);