You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by "FSchumacher (via GitHub)" <gi...@apache.org> on 2023/04/20 15:34:56 UTC

[GitHub] [jmeter] FSchumacher commented on a diff in pull request #5809: Bug #5807 - Fix an ArrayIndexOutOfBoundsException on HTTP parameters …

FSchumacher commented on code in PR #5809:
URL: https://github.com/apache/jmeter/pull/5809#discussion_r1172770856


##########
src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/visualizers/RequestViewHTTPTest.java:
##########
@@ -193,4 +194,20 @@ public void testGetQueryMapSoapHack() {
         Assert.assertEquals(query, param1.getValue()[0]);
         Assert.assertTrue(StringUtils.isBlank(param1.getKey()));
     }
+    
+    @Test
+    public void testGetQueryMapWithEmptyKeyAndValue() {
+        String query = "k1=v1&=&k2=v2";
+        Map<String, String[]> params = RequestViewHTTP.getQueryMap(query);
+        Assert.assertNotNull(params);
+        Assertions.assertEquals(2, params.size() + 1); // 2 params found

Review Comment:
   I think the comment is misleading and the assertion should be a different one.
   ```suggestion
           Assertions.assertEquals(1, params.size()); // first param is extracted, only
   ```
   The parsing will be stopped on the first error, which is the isolated `=`.



-- 
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-unsubscribe@jmeter.apache.org

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