-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
Describe the bug
When using a CookieRequestCache
, the first request after authentication is served using the platform's default Locale instead of the user's.
To Reproduce
See sample app.
Navigate directly to http://localhost:8080/some-home (log in with user:{generated-uuid}), the first request after authentication is served using the platform's default (in my case en-US) instead of fr-FR which my browser's asked.
When refreshing, navigating, etc. after, all requests are served in french, respecting my Accept-Language header.
Expected behavior
The first request after authentication should respect the user's language preference.
Sample
saved-request-locale-bug.zip
I have included 2 HAR files, one using the native CookieRequestCache
and one using a fixed CookieRequestCache
where the Locale
is set in the created SavedRequest
.
It seems CookieRequestCache is only missing the line builder.setLocales(Collections.list(request.getLocales()));
at line 77 (spring-security 6.1.1).