Skip to content

@ResponseBody throws HttpMediaTypeNotAcceptableException if client accepts "*/*" [SPR-6686] #11352

@spring-projects-issues

Description

@spring-projects-issues

Stefan Feier opened SPR-6686 and commented

It seems an old bug has cropped up again, see #10882

protected boolean isSupported(MediaType mediaType) {
	if (mediaType == null) {
		return true;
	}
	for (MediaType supportedMediaType : getSupportedMediaTypes()) {
		if (supportedMediaType.includes(mediaType)) {
			return true;
		}
	}
	return false;
}

I think the check should be reversed:

if (mediaType.includes(supportedMediaType)) ....


Affects: 3.0 GA

Issue Links:

Referenced from: commits 8d5fc2b

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