mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Polish contribution
See gh-34223
This commit is contained in:
+5
-5
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user