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

RestTemplate with MockMvcClientHttpRequestFactory double encodes URIs [SPR-15254] #19819

Closed
spring-projects-issues opened this issue Feb 14, 2017 · 2 comments
Assignees
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Feb 14, 2017

Jan-Espen Oversand opened SPR-15254 and commented

Using an URI with an email address as a request parameter with a RestTemplate method causes the @ to be double encoded. It should be encoded as %40, but will eventually end up as %2540. The reason is that the MockMvcClientHttpRequestFactory will run .toString() on the URI before passing it over to the MockMvc request builder. The MockMvc request builder assumes that Strings are unencoded, and will (re-) encode the URI. Passing it as an URI to the MockMvc builder will skip that encoding step.


Affects: 4.3.6

Referenced from: commits c3cc42d, a356116

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Feb 14, 2017

Jan-Espen Oversand commented

Pull request at #1326

Loading

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Feb 14, 2017

Juergen Hoeller commented

Good catch!

Loading

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

Successfully merging a pull request may close this issue.

None yet
2 participants