Skip to content

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

@kevin-wimmer

Description

@kevin-wimmer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions