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

fix query string for POST request not being set correctly #497

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,15 @@ private void decodeHeader(BufferedReader in, Map<String, String> pre, Map<String
// Decode parameters from the URI
int qmi = uri.indexOf('?');
if (qmi >= 0) {
decodeParms(uri.substring(qmi + 1), parms);
queryParameterString = uri.substring(qmi + 1);
decodeParms(queryParameterString, parms);
uri = NanoHTTPD.decodePercent(uri.substring(0, qmi));
} else {
queryParameterString = "";
uri = NanoHTTPD.decodePercent(uri);
}


// If there's another token, its protocol version,
// followed by HTTP headers.
// NOTE: this now forces header names lower case since they are
Expand Down Expand Up @@ -308,11 +311,9 @@ private int scipOverNewLine(byte[] partHeaderBuff, int index) {
*/
private void decodeParms(String parms, Map<String, List<String>> p) {
if (parms == null) {
this.queryParameterString = "";
return;
}

this.queryParameterString = parms;
StringTokenizer st = new StringTokenizer(parms, "&");
while (st.hasMoreTokens()) {
String e = st.nextToken();
Expand Down