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

Invalid/missing locale strings in header prevents resolving the locale [SPR-16500] #21043

Closed
spring-projects-issues opened this issue Feb 15, 2018 · 1 comment
Assignees
Labels
in: web type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Feb 15, 2018

Stephen Imhoff opened SPR-16500 and commented

Spring Boot 2.0.0.M7 with the web-flux starter.

Not sure if I just have a screw loose or what, but invalid locale strings ("en_US" instead of "en-US") or missing the header entirely seems to prevent any locale from being resolved in controllers and elsewhere. Supplying a LocaleContextResolver bean doesn't seem to help. LocaleResolver doesn't seem to be compatible due to version, it looks like.

I think I would have anticipated a null locale, instead of a 500 error, or at least a 400...


Affects: 5.0.3

Attachments:

Issue Links:

  • #21002 AcceptHeaderLocaleResolver should match country locales against supported language locales
  • #19987 Revise AcceptHeaderLocaleResolver default locale handling

Referenced from: commits cd8a1bd

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Feb 15, 2018

Juergen Hoeller commented

AcceptHeaderLocaleContextResolver is indeed too strict about this, and needs to leniently handle invalid Accept-Language headers (just like the Servlet API does). As for the contract, this is a separate (but same-named) LocaleContextResolver SPI for WebFlux which I'm also bringing up to date with #21002 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web type: bug
Projects
None yet
Development

No branches or pull requests

2 participants