Skip to content
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

View controller doesn't allow defining specific content type and character encoding #918

Open
bivapa opened this issue Oct 30, 2024 · 0 comments

Comments

@bivapa
Copy link

bivapa commented Oct 30, 2024

Expected Behavior

When I define a controller with a View response type and I set a specific content type and character encoding on the response object I expect these content type and character encoding to actually be applied to the rendered response.

Actual Behaviour

When I define a controller with a View response type and I set a specific content type and character encoding on the response object the actual rendered response contains default content type (text/html) and character encoding (UTF-8).

Steps To Reproduce

  1. Clone the example application
  2. Run mvn test
  3. The following tests will fail:
  • testViewControllerReturnsDefinedMediaType
  • testViewControllerReturnsDefinedCharacterEncoding
  1. The test testViewControllerEncodesCorrectCharacters will pass as the response content is interpreted as UTF-8
  2. The tests testTextControlller... will pass as the ordinary controller works as expected

Environment Information

Java 17

Example Application

https://github.com/bivapa/micronaut-view-char-encoding-bug-report

Version

4.6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant