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-issuemaster opened this issue Feb 14, 2017 · 2 comments

Comments

@spring-issuemaster
Copy link
Collaborator

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 14, 2017

Jan-Espen Oversand commented

Pull request at #1326

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 14, 2017

Juergen Hoeller commented

Good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.