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

Endless loop when path contains { without paired "}" #1713

Open
kool79 opened this issue Aug 2, 2023 · 1 comment · Fixed by #1714
Open

Endless loop when path contains { without paired "}" #1713

kool79 opened this issue Aug 2, 2023 · 1 comment · Fixed by #1714

Comments

@kool79
Copy link
Contributor

kool79 commented Aug 2, 2023

Steps to reproduce

 var url = "http://server.com/api/product{xxx" // this url may come from uny source
 RestAssured.given().get(url);

Actual: endless loop
Expected: url is sent with properly encoded characters in path: GET http://server.com/api/product%7Bxxx

Note that character "}" is properly encoded when used in url.

Endless loop is ocurred in RequestSpecificationImp#partiallyApplyPathParams, in the while() loop.
v5.1.1
scr_2023_08_02T15_33_59
Need to exit the "while" loop if indexOfEndBracket < 0

PS> I know that path in my example contains forbidden character but it should not cause endless loop. Actually we can get URL from any sources. Currently RestAssures properly encode all forbided characters in path: ", }, etc
But fail with the "{"

@kool79 kool79 changed the title Endless loop when path contains } { combination Endless loop when path contains { without paired "}" Aug 2, 2023
kool79 added a commit to kool79/rest-assured that referenced this issue Aug 2, 2023
@johanhaleby johanhaleby reopened this Dec 8, 2023
@johanhaleby
Copy link
Collaborator

johanhaleby commented Dec 8, 2023

@kool79 I had to revert your pull request because it broke the test io.restassured.itest.java.PathParamITest#throwsIllegalArgumentExceptionWhenTooManyPathParametersAreUsed. Could you address this in your PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants