Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CookieRequestCache ignores user Locale #13792

Closed
ArnaudLec opened this issue Sep 12, 2023 · 1 comment
Closed

CookieRequestCache ignores user Locale #13792

ArnaudLec opened this issue Sep 12, 2023 · 1 comment
Assignees
Labels
in: web An issue in web modules (web, webmvc) type: bug A general bug
Milestone

Comments

@ArnaudLec
Copy link

ArnaudLec commented Sep 12, 2023

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).

@ArnaudLec ArnaudLec added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Sep 12, 2023
@marcusdacoregio marcusdacoregio self-assigned this Sep 12, 2023
@marcusdacoregio marcusdacoregio added in: web An issue in web modules (web, webmvc) and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 12, 2023
@marcusdacoregio marcusdacoregio added this to the 5.8.7 milestone Sep 12, 2023
@marcusdacoregio
Copy link
Contributor

Thanks for the report @ArnaudLec, this is now fixed in 5.8.x, 6.0.x, 6.1.x and main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) type: bug A general bug
Projects
Status: No status
Development

No branches or pull requests

2 participants