-
Notifications
You must be signed in to change notification settings - Fork 38.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ServletRequestDataBinder ctor binding with
[]
-indexed query params
This change ensures that a request containing query parameters in the array format `someArray[]=value` can be bound into a simple array in constructors, even for cases where the array values don't have nested properties. The value resolver is directly called in the constructor case, before any mutable properties are considered or even cleared (see `WebDataBinder#adaptEmptyArrayIndices` method). As a result, we need to accommodate the possibility that the request stores array elements under the `name[]` key rather than `name`. This change attempts a secondary lookup with the `[]` suffix if the type is a list or array, and the key doesn't include an index. Closes gh-34121
- Loading branch information
1 parent
3505c4b
commit 0f38c28
Showing
3 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters