Bug report
The value of a URL parameter is duplicated for multipart/form-data requests with query parameters when the parameter values have encoded spaces. This is the same as https://github.com/spring-cloud/spring-cloud-netflix/issues/3300 however the issue is only present if values have spaces that are URI-encoded using + instead %20.
curl -X POST \
'http://127.0.0.1:8089/test?name=hello%20world' \
-H 'content-type: multipart/form-data;' \
-F key=value
results in
name = hello world
curl -X POST \
'http://127.0.0.1:8089/test?name=hello+world' \
-H 'content-type: multipart/form-data;' \
-F key=value
results in
name = hello world,hello world
It looks to me like it should use a more complete URI decoder like java.net.URLDecoder here https://github.com/spring-cloud/spring-cloud-netflix/blob/master/spring-cloud-netflix-zuul/src/main/java/org/springframework/cloud/netflix/zuul/util/RequestContentDataExtractor.java#L102
This last assertion does not hold:
assertThat(java.net.URLDecoder.decode("payout+memo")).isEqualTo("payout memo");
assertThat(StringUtils.uriDecode("payout%20memo", Charset.defaultCharset())).isEqualTo("payout memo");
assertThat(StringUtils.uriDecode("payout+memo", Charset.defaultCharset())).isEqualTo("payout memo");
Comment From: spencergibb
Version?
Comment From: reardonm
Doh.. forgot that. 2.1.1.RELEASE
Comment From: spencergibb
Can you retry with Greenwich.SR2 (2.1.2) to validate against the latest?
Comment From: reardonm
Indeed. My test fails on 2.1.2 as well. I'd put together a sample, but this is basically the same as https://github.com/s3erjaeh/example_for_spring-cloud-netflix-issue Only it needs to use '+' instead of '%20' to encode
Comment From: reardonm
Actually, easier would be the unit test: https://github.com/ryanjbaxter/spring-cloud-netflix/commit/8c754a714315b149fb329f03db5e0df8320e38dd#diff-e53a4bbd3f181f92cc926b2bca5d4c86R82
Comment From: spencergibb
This module has entered maintenance mode. This means that the Spring Cloud team will no longer be adding new features to the module. We will fix blocker bugs and security issues, and we will also consider and review small pull requests from the community.