You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using an Accept-Language header for HTTP requests that contains more than simple language or language-country forms, the parsed Locale does not correctly reflect the given language tag as defined in https://www.rfc-editor.org/rfc/rfc9110#section-12.5.4.
Language tags are parsed into a Locale that correctly reflects the given data; examples (not sure if zh-yue being turned into yue or ar-afb being turned into afb are correct, but that's what java.util.Locale turns it into):
run the application with ./mvnw clean compile quarkus:dev
either use the included tests.sh script to run some curl commands, or craft your own with an Accept-Language header for the URL http://localhost:8080/hello
note the response to see if the parsed Locale produces the same language tag as the given header
Output of uname -a or ver
Linux laverne 6.2.0-33-generic #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 7 10:33:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version
openjdk version "17.0.8.1" 2023-08-24
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.4.1
Build tool (ie. output of mvnw --version or gradlew --version)
Describe the bug
When using an Accept-Language header for HTTP requests that contains more than simple language or language-country forms, the parsed
Locale
does not correctly reflect the given language tag as defined in https://www.rfc-editor.org/rfc/rfc9110#section-12.5.4.Other examples of complex tags can be found in https://www.w3.org/International/articles/language-tags/.
Expected behavior
Language tags are parsed into a Locale that correctly reflects the given data; examples (not sure if
zh-yue
being turned intoyue
orar-afb
being turned intoafb
are correct, but that's whatjava.util.Locale
turns it into):Actual behavior
Simpler language tags are parsed correctly, but some of the more complex ones are not:
How to Reproduce?
i18n-with-quarkus-reactive.zip
./mvnw clean compile quarkus:dev
tests.sh
script to run somecurl
commands, or craft your own with anAccept-Language
header for the URLhttp://localhost:8080/hello
Output of
uname -a
orver
Linux laverne 6.2.0-33-generic #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 7 10:33:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "17.0.8.1" 2023-08-24
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.4.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.3 (21122926829f1ead511c958d89bd2f672198ae9f)
Additional information
No response
The text was updated successfully, but these errors were encountered: