-
Notifications
You must be signed in to change notification settings - Fork 477
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
559: fix multiple encodings of params #738
base: main
Are you sure you want to change the base?
559: fix multiple encodings of params #738
Conversation
@Climax85 Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@Climax85 Thank you for signing the Contributor License Agreement! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this one. The test cases don't seem to check for any double encoding in the first place. Their names aren't quite telling what the intend of the tests are actually.
Also, see my comment on checkParams(…)
. I didn't actually get the intention of the method.
I second @olivergierke 's comments. I'd start with a battery of tests exposing the issue at hand. In fact, the code you from #559 would be a perfect candidate to put into a unit test that you could then test away at ensuring it acts properly. |
Any update here? This bug makes ControllerLinkBuilder pretty much useless for non-template URLs. |
Do you have a test case that exposes the problems here? Also, there have been considerable changes to Spring HATEOAS since this ticket was opened including:
Please tell me if the latest version (1.1.0.M3 just came out) solves your problems. If not, can you provide a test case illustrating the issue. |
2e02d7a
to
856b6b9
Compare
5828e78
to
e643c37
Compare
In order to #559 I got multiple encodings using the ControllerLinkBuilder. I added corresponding tests and fixed the issue. The ControllerLinkBuilder#bindRequestParameters method already encodes the params in the template url. Any further expand of the url will encode the % sign in %25. So no additional encoding should be done.
The Link#expand method is not only used to expand parameters in the template but also to check for missing required parameters.
I added another checkParams method to the UriTemplate class to only check the params but not encoding them.