Skip to content
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

Form content length falsify #3329

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ static HttpServletRequest getRequestWithBodyFromRequestParameters(HttpServletReq
Map.Entry<String, String[]> entry = entryIterator.next();
String name = entry.getKey();
List<String> values = Arrays.asList(entry.getValue());
boolean wrote = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change name to valueWritten

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

for (Iterator<String> valueIterator = values.iterator(); valueIterator.hasNext();) {
String value = valueIterator.next();
List<String> queryValues = queryParams.get(name);
Expand All @@ -139,9 +140,10 @@ static HttpServletRequest getRequestWithBodyFromRequestParameters(HttpServletReq
writer.write('&');
}
}
wrote = true;
}
}
if (entryIterator.hasNext()) {
if (wrote && entryIterator.hasNext()) {
writer.append('&');
}
}
Expand Down
Loading