Apache Tomcat Updates Impose Hard Limit on Accept-Language Header Locales
Recent Apache Tomcat updates introduce a default cap of 10 locales for the Accept-Language header, which may cause service interruptions for applications requiring more extensive language configurations.
Apache Tomcat 9.0.123, 10.1.61, and 11.0.27 change how the server processes the Accept-Language header by introducing a hard cap of 10 locales.
Applications calling request.getLocale() will trigger a java.lang.IllegalArgumentException if incoming requests exceed this limit. This behavior can cause login failures and service interruptions for users with extensive browser language preferences.
You should check your traffic logs to see if your user base sends headers containing more than 10 languages.
The Apache Tomcat team categorized requests to increase the default limit as "WONTFIX" in their internal bug tracking system, meaning the hard cap remains for default installations. If your application requires support for more than 10 locales, you must manually change the configuration.
To fix the errors and revert to older Tomcat behavior, modify the maxLocaleCount attribute in the connector settings inside server.xml and set it to -1, which disables the restriction entirely.
