Skip to content

MultipartHttpServletRequest.getParameterValues does not merge values from query string and body [SPR-16590] #21132

@spring-projects-issues

Description

@spring-projects-issues

Jason Joo opened SPR-16590 and commented

Affected method:

DefaultMultipartHttpServletRequest::getParameterValues
DefaultMultipartHttpServletRequest::getParameterMap

getParameterValues is used to return multi values of a same key in request, including query string, post contents.
And DefaultMultipartHttpServletRequest would be used instead of default servlet wrapper when using "multipart/form-data" post method to realize including vars in multipart body. And there is a problem in its getter in dealing values of same keys. It will not merge them to values in query string.

It can be reproduced by following steps:

curl -F "key1=test" "http://test.com/hello?key1=other"

You will get a parameter map like:

key1: [test]

curl -d "key1=test" "http://test.com/hello?key1=other"

And you will get:

key1: [test, other]

Let's sit down to discuss whether fix it?


Affects: 5.0.4

Reference URL: #1740

Referenced from: commits ab6a6f4

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions