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

Harmonize the usage of charset in the Content-Type headers for RESTEasy Reactive #25390

Merged
merged 1 commit into from
May 16, 2022

Conversation

geoand
Copy link
Contributor

@geoand geoand commented May 5, 2022

The idea is that we know only append it for specific response media types.
Before this change, the charset was added depending on how the return type
of the Resource method

Relates to: #25295

@geoand
Copy link
Contributor Author

geoand commented May 10, 2022

@FroMage @stuartwdouglas can I get a review of this please?

Thanks


// TODO: does this need to be more complex?
private boolean isStringMediaType(MediaType mediaType) {
return mediaType.getType().equals("application")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All application/* types require a charset? That doesn't seem right.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which ones should in your opinion. JSON and XML?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to be much more strict

@geoand geoand force-pushed the #25295 branch 2 times, most recently from de8ac98 to 49ec0e2 Compare May 16, 2022 12:46
@quarkus-bot

This comment has been minimized.

Copy link
Contributor

@gastaldi gastaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@geoand geoand dismissed FroMage’s stale review May 16, 2022 13:04

comments addressed

@geoand geoand added the triage/waiting-for-ci Ready to merge when CI successfully finishes label May 16, 2022
@quarkus-bot

This comment has been minimized.

…sy Reactive

The idea is that we know only append it for specific response media types.
Before this change, the charset was added depending on how the return type
of the Resource method

Relates to: quarkusio#25295
@gsmet gsmet merged commit 9cf5ea2 into quarkusio:main May 16, 2022
@quarkus-bot quarkus-bot bot added this to the 2.10 - main milestone May 16, 2022
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label May 16, 2022
@gsmet gsmet modified the milestones: 2.10 - main, 2.9.1.Final May 16, 2022
@geoand geoand deleted the #25295 branch May 17, 2022 04:26
@FroMage
Copy link
Member

FroMage commented Jun 2, 2022

I wonder if this is what's caused a Renarde test to fail when bumping from 2.9.0 to 2.9.1:

[ERROR] Failures: 
[ERROR]   RenardeResourceTest.testTemplateEndpoint:53 1 expectation failed.
Expected content-type is "text/html" doesn't match actual content-type "text/plain;charset=UTF-8".

@geoand
Copy link
Contributor Author

geoand commented Jun 2, 2022

The change should only affect the charset...

@FroMage
Copy link
Member

FroMage commented Jun 2, 2022

I would have thought too, but given that a charset appeared… Lemme try to figure it out.

@FroMage
Copy link
Member

FroMage commented Jun 2, 2022

Actually it shouldn't be that, because it works in 2.9.1 and 2.9.2 as well, but it's broken in main. I'll report an issue.

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

Successfully merging this pull request may close these issues.

4 participants