Skip to content

@RequestMapping content negotiation should not impact error responses formats #22452

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
bclozel opened this issue Feb 21, 2019 · 0 comments
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@bclozel
Copy link
Member

bclozel commented Feb 21, 2019

This issue a follow-up issue to #20865.

In #20865, the negotiated content-type during the request mapping phase would impact the content type chosen for the @ExceptionHandler error response instead of restarting the content negotiation phase. This has been fixed by removing the negotiated content type before handling errors.

In this case, the negotiated content type information is kept in a different place.

When setting up the reactive pipeline with the chosen EncoderHttpMessageWriter, the response content type is set before the subscription happens. Later when the returned value from the error handling phase is handled in HandlerResultHandlerSupport.selectMediaType, the response content-type is already set and chosen directly.

The only difference with #20865 is that the content type is set before the subscription happens and is not cleared before handling the error response.

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) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant