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

[GitHub] [jmeter] milamberspace opened a new pull request, #5809: Bug #5807 - Fix an ArrayIndexOutOfBoundsException on HTTP parameters …

milamberspace opened a new pull request, #5809:
URL: https://github.com/apache/jmeter/pull/5809

   … line on special case when key and value are empty, i.e.: "k1=v1&=&k2=v2"
   
   ## Description
   Fix parsing issue on special case when key and value are empty, i.e.: "k1=v1&=&k2=v2"
   
   ## Motivation and Context
   Related to https://github.com/apache/jmeter/issues/5807
   
   ## How Has This Been Tested?
   Run the provided test case from https://github.com/apache/jmeter/issues/5807 and followed the instructions given there.
   
   ## Screenshots (if appropriate):
   
   ## Types of changes
   - Bug fix (non-breaking change which fixes an issue)
   
   ## Checklist:
   - [X] My code follows the [code style][style-guide] of this project.
   


-- 
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


[GitHub] [jmeter] milamberspace closed pull request #5809: Bug #5807 - Fix an ArrayIndexOutOfBoundsException on HTTP parameters …

Posted by "milamberspace (via GitHub)" <gi...@apache.org>.
milamberspace closed pull request #5809: Bug #5807 - Fix an ArrayIndexOutOfBoundsException on HTTP parameters …
URL: https://github.com/apache/jmeter/pull/5809


-- 
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


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

Posted by "FSchumacher (via GitHub)" <gi...@apache.org>.
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