Skip to content

Accept header should not be mandatory for properly handling response body. [SPR-6248] #10916

@spring-projects-issues

Description

@spring-projects-issues

Sergio Bossa opened SPR-6248 and commented

While trying to find suitable HttpMessageConverters for a custom object returned by a RequestMapping-annotated method, AnnotationMethodHandlerAdapter#handleResponseBody(Object, ServletWebRequest) fails because the request doesn't contain any Accept header.

However, the Http rfc states as follows (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html):

"If no Accept header field is present, then it is assumed that the client accepts all media types."

So, Accept header should not be mandatory: if not present, the response body should be handled whatever its media type.


Affects: 3.0 RC1

Referenced from: commits d54a975

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions