Fixes a problem with missing locale if HttpServletRequest#getLocale throws exception

This commit is contained in:
Lukasz Lenart
2020-05-11 14:55:35 +02:00
parent 0129d30abf
commit 28bc351e31
@@ -758,7 +758,12 @@ public class Dispatcher {
locale = request.getLocale();
}
} else {
locale = request.getLocale();
try {
locale = request.getLocale();
} catch (RuntimeException e) {
LOG.warn("Cannot get locale from Http Request, falling back to system default locale", e);
locale = Locale.getDefault();
}
}
return locale;
}