Skip to content

Commit d0393ea

Browse files
committed
SPR-7233 - ResponseEntity having body, headers and HttpStatus mixed up in responseEntity.getBody()
1 parent 75c5405 commit d0393ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerAdapter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -839,12 +839,12 @@ public ModelAndView getModelAndView(Method handlerMethod, Class handlerType, Obj
839839
}
840840
}
841841

842-
if (AnnotationUtils.findAnnotation(handlerMethod, ResponseBody.class) != null) {
843-
handleResponseBody(returnValue, webRequest);
842+
if (returnValue instanceof HttpEntity) {
843+
handleHttpEntityResponse((HttpEntity<?>) returnValue, webRequest);
844844
return null;
845845
}
846-
else if (returnValue instanceof HttpEntity) {
847-
handleHttpEntityResponse((HttpEntity<?>) returnValue, webRequest);
846+
else if (AnnotationUtils.findAnnotation(handlerMethod, ResponseBody.class) != null) {
847+
handleResponseBody(returnValue, webRequest);
848848
return null;
849849
}
850850
else if (returnValue instanceof ModelAndView) {

0 commit comments

Comments
 (0)