You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "epou (via GitHub)" <gi...@apache.org> on 2026/10/20 11:23:17 UTC

[PR] Preserve backward compatibility by defaulting maxLocaleCount to -1 [tomcat]

epou opened a new pull request, #1096:
URL: https://github.com/apache/tomcat/pull/1096

   The commit c45c9b47f34837aa35cbd4d677e82440db620a00 introduced `maxLocaleCount` with a default of 10. Requests exceeding this limit throw `IllegalArgumentException` when the application calls `HttpServletRequest.getLocale()` or `getLocales()`.
   
   This changes previously working behavior in a patch release. Legitimate customers will experience failures after upgrading because their browsers send more than 10 language entries in Accept-Language.
   
   [RFC 9110 ยง12.5.4](https://www.rfc-editor.org/rfc/rfc9110.html#section-12.5.4) specifies no maximum number of language entries. Browsers allow users to configure multiple preferred languages and may add language-only fallback entries, so exceeding 10 does not necessarily indicate malformed or abusive traffic.
   
   This PR changes the default `maxLocaleCount` to `-1`, preserving the previous behavior while retaining the configurable limit for deployments that need it.
   
   The resource-protection rationale for introducing this setting is understandable. However, enabling a restrictive default in a patch release can cause existing applications to fail for valid requests without any application or configuration changes. The exception may also propagate through frameworks that access request locales implicitly, making the impact difficult to anticipate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PR] Preserve backward compatibility by defaulting maxLocaleCount to -1 [tomcat]

Posted by "epou (via GitHub)" <gi...@apache.org>.
epou commented on PR #1096:
URL: https://github.com/apache/tomcat/pull/1096#issuecomment-6357705698

   I've opened a thread on the Tomcat Users mailing list: 
    https://lists.apache.org/thread.html/6wtt1tks7y3c1lz76rpb0pcgn0om3dnc


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PR] Preserve backward compatibility by defaulting maxLocaleCount to -1 [tomcat]

Posted by "be-hase (via GitHub)" <gi...@apache.org>.
be-hase commented on PR #1096:
URL: https://github.com/apache/tomcat/pull/1096#issuecomment-6356261818

   +1. 
   
   We upgraded promptly for the [CVE](https://tomcat.apache.org/security-11.html) fixes and read through the changelog, but the only
   related entry was ["Optimize Accept-Language header processing..."](https://tomcat.apache.org/tomcat-11.0-doc/changelog.html), so we didn't realize
   this introduced a new limit until it hit us in production.
   
   As you said, it was easy to fix with `maxLocaleCount="-1"`. The hard part was knowing
   there was anything to fix in the first place. Lesson learned, I guess :)
   
   I'd prefer `-1` as the default as well.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PR] Preserve backward compatibility by defaulting maxLocaleCount to -1 [tomcat]

Posted by "rmaucher (via GitHub)" <gi...@apache.org>.
rmaucher closed pull request #1096: Preserve backward compatibility by defaulting maxLocaleCount to -1
URL: https://github.com/apache/tomcat/pull/1096


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PR] Preserve backward compatibility by defaulting maxLocaleCount to -1 [tomcat]

Posted by "rmaucher (via GitHub)" <gi...@apache.org>.
rmaucher commented on PR #1096:
URL: https://github.com/apache/tomcat/pull/1096#issuecomment-6289893926

   It is easy to adjust the property. If you want to discuss what kind of default would be more suitable, you can use the tomcat-users mailing list.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org