-
Notifications
You must be signed in to change notification settings - Fork 559
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
Duplicate values in the AwsProxyHttpServletRequest.getParameterMap() #86
Comments
Hey @avinashbitra, can you share what the original request you sent looks like? |
@sapessi |
@sapessi issue here is inside the spring framework while using spring rest repositories and making a http get request with query parameters, framework is trying to map the request parameters to method parameters. While framework is trying to map the parameters, it makes multiple request.getParameterMap() invocations and because of the above code we are seeing duplicate values for a parameter and ends up with wrong parameter value passed to the method. |
@sapessi Is there any update on this. |
Hey @avinashbitra, I'll try to get this fixed for the next release of the framework. I'm at home on Paternity leave for the next 2 weeks. |
Thanks @sapessi |
The latest commit addresses this issue. I'm closing this for the time being. |
File: AwsProxyHttpServletRequest
@OverRide
public Map<String, String[]> getParameterMap() {
Map<String, String[]> output = new HashMap<>();
Map<String, List> params = urlEncodedFormParameters
.....
if (params.containsKey(entry.getKey())) {
params.get(entry.getKey()).add(entry.getValue());
}
.....
urlEncodedFormParameters are initialized in the constructor and getParameterMap whenever invoked keeps adding to the same Map which ends up in having duplicate values.
Map<String, List> params = this.getFormUrlEncodedParametersMap();
should reset the params map.
The text was updated successfully, but these errors were encountered: