Skip to content

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

Closed

Description

@spring-projects-issues

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:

Referenced from: commits cd8a1bd

Activity

  1. spring-projects-issues commented on Feb 15, 2018

    @spring-projects-issues
    CollaboratorAuthor

    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.

  2. added
    type: bug
    in: web
    on Jan 11, 2019
  3. added this to the 5.0.4 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webtype: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions