Skip to content

Provide option to disable binding HTTP headers to model attribute properties #33961

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

Closed
kevin-wimmer opened this issue Nov 25, 2024 · 1 comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue

Comments

@kevin-wimmer
Copy link

In Spring 6.2, ExtendedServletRequestDataBinder was updated to bind HTTP headers to model attribute properties. This breaks some forms where property names happen to match the names of unrelated HTTP headers. For example, I have a form with a "Priority" field that gets bound to a "priority" property in my model object. This field allows values of "P1," "P2," "P3," "P4," "P5," and blank. When the value is left blank, however, Spring binds the Priority header to this property. The header value does not conform to the set of valid values for this property and, thus, triggers a validation error. This issue is to request that this new header-binding functionality be made optional (either via a global configuration property or via a new parameter on the @validated annotation).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 25, 2024
@bclozel bclozel added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Dec 10, 2024
@bclozel
Copy link
Member

bclozel commented Dec 10, 2024

Duplicates #34039

@bclozel bclozel closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2024
@bclozel bclozel added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants