diff --git a/core/src/main/java/org/nanohttpd/protocols/http/HTTPSession.java b/core/src/main/java/org/nanohttpd/protocols/http/HTTPSession.java index e8df9338..629940db 100644 --- a/core/src/main/java/org/nanohttpd/protocols/http/HTTPSession.java +++ b/core/src/main/java/org/nanohttpd/protocols/http/HTTPSession.java @@ -157,12 +157,15 @@ private void decodeHeader(BufferedReader in, Map pre, Map= 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 @@ -308,11 +311,9 @@ private int scipOverNewLine(byte[] partHeaderBuff, int index) { */ private void decodeParms(String parms, Map> p) { if (parms == null) { - this.queryParameterString = ""; return; } - this.queryParameterString = parms; StringTokenizer st = new StringTokenizer(parms, "&"); while (st.hasMoreTokens()) { String e = st.nextToken();