Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix structural parameters with POST request. #7193

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kiy0taka
Copy link

@kiy0taka kiy0taka commented Apr 8, 2022

With structural parameter page and following POST requests:

POST https://www.example.com/app/aaa page=p1&ddd=eee
POST https://www.example.com/app/aaa page=p2&ddd=fff

Parameter names are used for nodes, so different values are combined into one node.
image

Fixed so that parameter values are used for different nodes.
image

Signed-off-by: kiy0taka <kiy0taka333@gmail.com>
Signed-off-by: kiy0taka <kiy0taka333@gmail.com>
@kiy0taka kiy0taka force-pushed the fix/post-structural-parameters branch from b2ad2e1 to 122cfdb Compare April 8, 2022 01:22
@psiinon
Copy link
Member

psiinon commented Apr 19, 2022

Thanks - will review this asap...

@kingthorin
Copy link
Member

* What went wrong:
Execution failed for task ':zap:spotlessJavaCheck'.
> The following files had format violations:
      zap/src/test/java/org/zaproxy/zap/model/StandardParameterParserUnitTest.java
          @@ -19,6 +19,7 @@
           ·*/
           package·org.zaproxy.zap.model;
           
          +import·static·java.util.Arrays.asList;
           import·static·org.hamcrest.MatcherAssert.assertThat;
           import·static·org.hamcrest.Matchers.empty;
           import·static·org.hamcrest.Matchers.equalTo;
          @@ -26,7 +27,6 @@
           import·static·org.hamcrest.Matchers.is;
           import·static·org.hamcrest.Matchers.nullValue;
           import·static·org.junit.jupiter.api.Assertions.assertEquals;
          -import·static·java.util.Arrays.asList;
           
           import·java.util.ArrayList;
           import·java.util.List;
  Run './gradlew :zap:spotlessApply' to fix these violations.

Signed-off-by: kiy0taka <kiy0taka333@gmail.com>
@kingthorin
Copy link
Member

Thanks @kiy0taka

@psiinon psiinon requested a review from thc202 April 20, 2022 13:26
@@ -80,6 +82,53 @@ void defaultParser() {
assertEquals(res2.get(3).getValue(), "g");
}

@Test
void defaultTreePath() throws HttpMalformedHeaderException, URIException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use parameterized tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also be good to add one that has both query and form parameters.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added test cases using ParameterizedTest.

@kiy0taka kiy0taka force-pushed the fix/post-structural-parameters branch from 842b7c5 to c3f7af2 Compare April 21, 2022 04:22
Signed-off-by: kiy0taka <kiy0taka333@gmail.com>
Signed-off-by: kiy0taka <kiy0taka333@gmail.com>
@kiy0taka kiy0taka force-pushed the fix/post-structural-parameters branch from c3f7af2 to 15de3b7 Compare April 21, 2022 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants