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 14:40:52 UTC

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

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

   …s 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] FSchumacher commented on a diff in pull request #5808: Bug GH 5807 - Fix an ArrayIndexOutOfBoundsException on HTTP parameter…

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


[GitHub] [jmeter] milamberspace closed pull request #5808: Bug GH 5807 - Fix an ArrayIndexOutOfBoundsException on HTTP parameter…

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


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