In our automatic tests the URI is clicked through the WebDriver, and the HtmlUnitRequestBuilder decoded the plus sign. Therefore the controller is called with an invalid ISO fate format:
Caused by: java.time.format.DateTimeParseException: Text '2017-05-16T00:59:59.999999999 02:00[Europe/Berlin]' could not be parsed, unparsed text found at index 29
at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1952)
at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)
at java.time.ZonedDateTime.parse(ZonedDateTime.java:597)
at org.springframework.format.datetime.standard.TemporalAccessorParser.parse(TemporalAccessorParser.java:78)
at org.springframework.format.datetime.standard.TemporalAccessorParser.parse(TemporalAccessorParser.java:46)
at org.springframework.format.support.FormattingConversionService$ParserConverter.convert(FormattingConversionService.java:200)
... 81 common frames omitted
Affects: 5.0.7
Issue Links:
#21577 Support stricter encoding of URI variables in UriComponents ("depends on")
#22161 UriComponentsBuilder.toUriString() is broken
1 votes, 5 watchers
The text was updated successfully, but these errors were encountered:
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.
Arne Landwehr opened SPR-17027 and commented
UriComponentsBuilder
doesn't encode "+" signs anymore if they are part of a query parameter (#21259), which is the desired behavior according to this.Unfortunately,
HtmlUnitRequestBuilder
tries to decode the not encoded plus sign and we therefore end up with a space which breaks the URI.Here is our concrete setup:
We have a spring boot 2 app with Thymeleaf and automatic UI tests.
Thymeleaf template:
Controller:
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
WebDriver
, and theHtmlUnitRequestBuilder
decoded the plus sign. Therefore the controller is called with an invalid ISO fate format:(plus sign replaced by whitespace)
Exception:
Affects: 5.0.7
Issue Links:
1 votes, 5 watchers
The text was updated successfully, but these errors were encountered: