|
|
|
@ -33,6 +33,8 @@ import org.springframework.core.ResolvableType; |
|
|
|
import org.springframework.http.HttpEntity; |
|
|
|
import org.springframework.http.HttpEntity; |
|
|
|
import org.springframework.http.HttpHeaders; |
|
|
|
import org.springframework.http.HttpHeaders; |
|
|
|
import org.springframework.http.HttpMethod; |
|
|
|
import org.springframework.http.HttpMethod; |
|
|
|
|
|
|
|
import org.springframework.http.HttpStatus; |
|
|
|
|
|
|
|
import org.springframework.http.HttpStatusCode; |
|
|
|
import org.springframework.http.ProblemDetail; |
|
|
|
import org.springframework.http.ProblemDetail; |
|
|
|
import org.springframework.http.RequestEntity; |
|
|
|
import org.springframework.http.RequestEntity; |
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
@ -239,9 +241,9 @@ public class HttpEntityMethodProcessor extends AbstractMessageConverterMethodPro |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (httpEntity instanceof ResponseEntity<?> responseEntity) { |
|
|
|
if (httpEntity instanceof ResponseEntity<?> responseEntity) { |
|
|
|
int returnStatus = responseEntity.getStatusCode().value(); |
|
|
|
HttpStatusCode httpStatusCode = responseEntity.getStatusCode(); |
|
|
|
outputMessage.getServletResponse().setStatus(returnStatus); |
|
|
|
outputMessage.getServletResponse().setStatus(httpStatusCode.value()); |
|
|
|
if (returnStatus == 200) { |
|
|
|
if (HttpStatus.OK.value() == httpStatusCode.value()) { |
|
|
|
HttpMethod method = inputMessage.getMethod(); |
|
|
|
HttpMethod method = inputMessage.getMethod(); |
|
|
|
if ((HttpMethod.GET.equals(method) || HttpMethod.HEAD.equals(method)) |
|
|
|
if ((HttpMethod.GET.equals(method) || HttpMethod.HEAD.equals(method)) |
|
|
|
&& isResourceNotModified(inputMessage, outputMessage)) { |
|
|
|
&& isResourceNotModified(inputMessage, outputMessage)) { |
|
|
|
@ -249,8 +251,8 @@ public class HttpEntityMethodProcessor extends AbstractMessageConverterMethodPro |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if (returnStatus / 100 == 3) { |
|
|
|
else if (httpStatusCode.is3xxRedirection()) { |
|
|
|
String location = outputHeaders.getFirst("location"); |
|
|
|
String location = outputHeaders.getFirst(HttpHeaders.LOCATION); |
|
|
|
if (location != null) { |
|
|
|
if (location != null) { |
|
|
|
saveFlashAttributes(mavContainer, webRequest, location); |
|
|
|
saveFlashAttributes(mavContainer, webRequest, location); |
|
|
|
} |
|
|
|
} |
|
|
|
|