Skip to content

HttpEntityMethodProcessor does not support HttpEntity/ResponseEntity subclasses [SPR-10207] #14840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Jan 22, 2013 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jan 22, 2013

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:

Referenced from: commits a3e190e, 3a6e7b8

Backported to: 3.1.4

0 votes, 5 watchers

@spring-projects-issues
Copy link
Collaborator Author

Darrin Holst commented

this no longer works due to this commit f6fbdaf#diff-3bd7894ff532bc788eeeaad49898f04fL76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants