Skip to content

Commit 3a6e7b8

Browse files
committed
Support sub-types of ResponseEntity
Issue: SPR-10207
1 parent 8a93309 commit 3a6e7b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -63,7 +63,7 @@ public boolean supportsParameter(MethodParameter parameter) {
6363

6464
public boolean supportsReturnType(MethodParameter returnType) {
6565
Class<?> parameterType = returnType.getParameterType();
66-
return HttpEntity.class.equals(parameterType) || ResponseEntity.class.equals(parameterType);
66+
return HttpEntity.class.isAssignableFrom(parameterType) || ResponseEntity.class.isAssignableFrom(parameterType);
6767
}
6868

6969
public Object resolveArgument(
@@ -123,7 +123,7 @@ public void handleReturnValue(
123123
if (!entityHeaders.isEmpty()) {
124124
outputMessage.getHeaders().putAll(entityHeaders);
125125
}
126-
126+
127127
Object body = responseEntity.getBody();
128128
if (body != null) {
129129
writeWithMessageConverters(body, returnType, inputMessage, outputMessage);

0 commit comments

Comments
 (0)