- 
        Couldn't load subscription status. 
- Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug
Milestone
Description
Shelley J. Baker opened SPR-10207 and commented
The HttpEntityMethodProcessor's supportsReturnType method explicitly looks for ResponseEntity/HttpEntity classes, not whether they are assignable from those classes:
public boolean supportsReturnType(MethodParameter returnType) {
	Class<?> parameterType = returnType.getParameterType();
	return HttpEntity.class.equals(parameterType) || ResponseEntity.class.equals(parameterType);
}
This prevents HttpEntity/ResponseEntity subclasses from being processed. This method should be updated similar to the following, in order to support HTTP entity subclasses:
public boolean supportsReturnType(MethodParameter returnType) {
    Class<?> parameterType = returnType.getParameterType();
    return HttpEntity.class.isAssignableFrom(parameterType);
}
This problem was first described here in #14680.
Affects: 3.1.3
Issue Links:
- Regression: HttpEntityMethodProcessor does not support HttpEntity subclasses anymore [SPR-12242] #16856 Regression: HttpEntityMethodProcessor does not support HttpEntity subclasses anymore
Referenced from: commits a3e190e, 3a6e7b8
Backported to: 3.1.4
0 votes, 5 watchers
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug