Copilot commented on code in PR #1821:
URL: https://github.com/apache/struts/pull/1821#discussion_r3682430832
##########
core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java:
##########
@@ -929,7 +944,7 @@ protected Locale getLocale(HttpServletRequest request) {
locale = LocaleUtils.toLocale(defaultLocale);
} catch (IllegalArgumentException e) {
try {
- locale = request.getLocale();
+ locale = resolveRequestLocale(request);
LOG.warn(new ParameterizedMessage("Cannot convert
'struts.locale' = [{}] to proper locale, defaulting to request locale [{}]",
defaultLocale, locale), e);
Review Comment:
The WARN log message can become inaccurate when
`struts.locale.validateRequestLocale=true`: `resolveRequestLocale()` may return
the JVM default (or a configured fallback), not the actual request locale, yet
the message says it's "defaulting to request locale". This can mislead
operators when diagnosing locale configuration problems.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]