Repository navigation
Conversation
Contributor
|
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The commit c45c9b4 introduced
maxLocaleCountwith a default of 10. Requests exceeding this limit throwIllegalArgumentExceptionwhen the application callsHttpServletRequest.getLocale()orgetLocales().First affected versions:
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 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
maxLocaleCountto-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.