milamberspace commented on code in PR #5812:
URL: https://github.com/apache/jmeter/pull/5812#discussion_r1174598191


##########
src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/visualizers/RequestViewHTTP.java:
##########
@@ -316,9 +322,10 @@ public static Map<String, String[]> getQueryMap(String 
query) {
                 System.arraycopy(known, 0, tmp, 0, known.length);
                 known = tmp;
             }
-            map.put(name, known);
+            if (validNameAndValue) {

Review Comment:
   > If `validNameAndValue` is false, `name` is `null`. If `validNameAndValue` 
is true, `name` is not `null`. The only code path that leads to putting 
something into the map (and not return directly) is where `name` is not `null`. 
Therefore we can skip all code, that is looking for values in the map, when 
`name` is `null`. Therefore we can widen the block from `if 
(validNameAndValue)` to line 314.
   
   With a params with no name but with one value, that will no works (like my 
test case "k1=v1&=value&k2=v2".
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to