-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Broken encoding in response body if application is running on OpenShift #21700
Comments
Do you have a cluster I could access to reproduce this? |
@geoand the issue was found in this Jenkins run[1], so the answers would be:
|
BTW, +100 for |
I test a sample RESTEasy Reactive application on Openshift 4.9 that simply does the following: @Path("/hello")
public class TestResource {
@GET
public Multi<String> hello() {
return Multi.createFrom().items("Γιώργος", "Slovník");
}
} and the response contains the proper characters. So in short, I can't reproduce this. |
@geoand I wasn't able to reproduce the error on your example either. But this one worked:
I presume, the gamechanger is |
I still could not reproduce it |
Any chance you can capture the actual data that is being sent over the wire (e.g. via wireshark)? |
@stuartwdouglas sniffing VPN traffic is beyond my wireshark-fu capabilities, but I managed to capture request and response with curl's tracing. Results of |
@fedinskiy does your Quarkus app run with a non default locale/encoding? |
@gsmet I do not pass any parameters to the application, and locale on the openshift node looks like that:
|
I wouldn't be surprised if it could be related to using a non-UTF-8 locale. I have no idea what should be used as the default charset for content types if you're not defining any charset in it. |
Well, IETF considers[1] ISO-8859-1(yikes!) as a default, but recommends[2] to use UTF-8. To my understanding, this particular example should work with both, but the latter option looks like a better idea. As a side note: since Quarkus is advertised as a Kubernetes-native framework[3], novice users(e.g. yours truly) expect that behaviour of their applications doesn't depend on the environment. [1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7.1 P.S. I am not sure, if anyone gets notifications about edits in the original post, so I will add it here: there is also a "minimal" reproducer: https://github.com/fedinskiy/quarkus-reproducer/tree/openshift_fail . |
nope, GitHub does not notify on updates |
The version of Quarkus you are using in the reproducer is very outdated. Can you try with |
Updated quarkus version in the reproducer. The result is the same. |
@geoand did you try locally with a |
I will give it a shot |
So indeed changing the locale makes this. I think I know what is causing it |
This was already being done when producing text/plain, but in cases where application/json was being used and the actual entity was a String, the encoding was not being specified Fixes: quarkusio#21700
#22644 fixes the issue |
This was already being done when producing text/plain, but in cases where application/json was being used and the actual entity was a String, the encoding was not being specified Fixes: quarkusio#21700
Ensure that UTF8 is used as the default encoding in RESTEasy Reactive
This was already being done when producing text/plain, but in cases where application/json was being used and the actual entity was a String, the encoding was not being specified Fixes: quarkusio#21700 (cherry picked from commit fe79da7)
Describe the bug
Given:
Expected behavior
The client should receive http response with "Slovník" in the body.
Actual behavior
The client receives http response with "Slovn?k" in the body.
How to Reproduce?
Reproducer:
https://github.com/fedinskiy/quarkus-test-suite/blob/openshift_fail/sql-db/hibernate-reactive/src/test/java/io/quarkus/ts/reactive/AbstractReactiveDatabaseIT.java#L37
Minimal reproducer:
https://github.com/fedinskiy/quarkus-reproducer/tree/openshift_fail
Scripts run.sh and stop.sh contain commands to start and stop the application on the OCP cluster respectively.
Run
curl ${path to your app}/hello/broken
to get the result.Output of
uname -a
orver
4.18.0-305.el8.x86_64
Output of
java -version
Java version: 11.0.12, vendor: Oracle Corporatio
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2c1be38
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
Additional information
OpenShift 4.9
The text was updated successfully, but these errors were encountered: