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 14:53:27 UTC

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

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


##########
src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/visualizers/RequestViewHTTP.java:
##########
@@ -287,6 +287,9 @@ public static Map<String, String[]> getQueryMap(String query) {
         String[] params = query.split(PARAM_CONCATENATE);
         for (String param : params) {
             String[] paramSplit = param.split("=");
+            if (paramSplit.length == 0) { // Bug Github 5807

Review Comment:
   I don't think the Bug reference is needed here, but I would love to see a unit test :)
   
   ```java
   public class RequestViewHTTPTest extends TestCase {
   
       @Test
       void testGetQueryMapWithEmptyKeyAndValue() {
           String query = "=";
           Map<String, String[]> params = RequestViewHTTP.getQueryMap(query);
           Assert.assertNotNull(params);
           Assertions.assertEquals(0, params.size());
       }
    ...
   ```



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