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

ControllerLinkBuilder does not handle special query parameter characters correctly #398

Closed
SingleShot opened this issue Oct 7, 2015 · 0 comments
Assignees
Milestone

Comments

@SingleShot
Copy link

We are experiencing issues using ControllerLinkBuilder with certain characters in query params, and must do some nasty hacks to get around it.

Consider this use of ControllerLinkBuilder:

linkTo(methodOn(BookController.class).findBooksByTitle("Spring#\n").withRel("book"));

Note the odd goofy search string with the # sign and Java newline. This results in an exception rather a proper link.

The link that one might expect to be generated is:

http://localhost/books?title=Spring#\n

Which when properly encoded would be:

http://localhost/books?title=Spring%23%0A

While those example characters may seem strange, a valid URL is possible when encoded properly, but the link builder is instead throwing.

@SingleShot SingleShot changed the title ControllerLinkBuilder Does Not Handle Special Query Params Characters Correctly ControllerLinkBuilder Does Not Handle Special Query Param Characters Correctly Oct 7, 2015
kevinconaway pushed a commit to kevinconaway/spring-hateoas that referenced this issue Jan 7, 2016
odrotbohm pushed a commit that referenced this issue Jan 7, 2016
…ory.

ControllerLinkBuilderFactory now forwards the source UriComponents to the ControllerLinkBuilder instead of turning it into a URI and a UriComponentsBuilder in turn.

Original pull request: #422.
odrotbohm added a commit that referenced this issue Jan 7, 2016
Some JavaDoc, formatting, copyright year expansion and author tags. Test method ordering.

Original pull request: #422.
@odrotbohm odrotbohm changed the title ControllerLinkBuilder Does Not Handle Special Query Param Characters Correctly ControllerLinkBuilder does not handle special query parameter characters correctly Jan 12, 2016
@odrotbohm odrotbohm added this to the 0.20 milestone Jan 12, 2016
@odrotbohm odrotbohm self-assigned this Jan 12, 2016
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