Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
RestTemplate with MockMvcClientHttpRequestFactory double encodes URIs [SPR-15254] #19819
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.