Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
HtmlUnitRequestBuilder decodes plus sign in query parameter [SPR-17027] #21565
Here is our concrete setup:
We have a spring boot 2 app with Thymeleaf and automatic UI tests.
public ModelAndView list(@RequestParam(name = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) ZonedDateTime exportDate)
Once the template is evaluated the final HTML contains the following URI:
(plus sign not encoded)
In our automatic tests the URI is clicked through the
(plus sign replaced by whitespace)
1 votes, 5 watchers
Rossen Stoyanchev commented
This was caused by the change UriComponents to not encode "+" indeed. The HtmlUnitRequestBuilder is doing the right thing by decoding, as request parameters are expected to be. The real issue is there is no way to control this behavior when using MvcUriComponentsBuilder. However once #21577, we should be able to address this one as well.